]> git.openstreetmap.org Git - chef.git/blob - cookbooks/community/templates/default/data.yml.erb
community: fix acme cert redirect. Add DB backup
[chef.git] / cookbooks / community / templates / default / data.yml.erb
1 # A container for all things Data, be sure to set a secret password for
2 # discourse account, SOME_SECRET is just an example
3 #
4
5 templates:
6   - "templates/postgres.template.yml"
7   - "templates/redis.template.yml"
8
9 # any extra arguments for Docker?
10 # docker_args:
11
12 params:
13   db_default_text_search_config: "pg_catalog.english"
14
15   ## Set db_shared_buffers to a max of 25% of the total memory.
16   ## will be set automatically by bootstrap based on detected RAM, or you can override
17   db_shared_buffers: "4096MB"
18
19   ## can improve sorting performance, but adds memory usage per-connection
20   #db_work_mem: "40MB"
21
22 env:
23   # ensure locale exists in container, you may need to install it
24   LC_ALL: en_US.UTF-8
25   LANG: en_US.UTF-8
26   LANGUAGE: en_US.UTF-8
27
28 volumes:
29   - volume:
30         host: /srv/community.openstreetmap.org/shared/data
31         guest: /shared
32   - volume:
33         host: /srv/community.openstreetmap.org/shared/data/log/var-log
34         guest: /var/log
35
36 # TODO: SOME_SECRET to a password for the discourse user
37 hooks:
38   after_postgres:
39     - exec:
40         stdin: |
41           alter user discourse with password '<%= @passwords["database"] %>';
42         cmd: su - postgres -c 'psql discourse'
43
44         raise_on_fail: false
45     - file:
46         path: /var/spool/cron/crontabs/postgres
47         contents: |
48           # m h  dom mon dow   command
49           # MAILTO=?
50           0 4 * * * /var/lib/postgresql/take-database-backup