]> git.openstreetmap.org Git - chef.git/blob - cookbooks/community/templates/default/web_only.yml.erb
a04b6965461fba97b1ddd6085a7bf1ca87eee7c0
[chef.git] / cookbooks / community / templates / default / web_only.yml.erb
1 templates:
2   - "templates/web.template.yml"
3   - "templates/web.ssl.template.yml"
4
5 # Disable rate limiting for the moment.
6 #  - "templates/web.ratelimited.template.yml"
7
8 ## which TCP/IP ports should this container expose?
9 ## If you want Discourse to share a port with another webserver like Apache or nginx,
10 ## see https://meta.discourse.org/t/17247 for details
11 expose:
12   - "80:80"   # http
13   - "443:443" # https
14
15 # Use 'links' key to link containers together, aka use Docker --link flag.
16 links:
17   - link:
18       name: data
19       alias: data
20
21 # any extra arguments for Docker?
22 # docker_args:
23
24 # Workaround bug: https://github.com/discourse/discourse_docker/pull/505
25 # params:
26 #  version: v2.8.13 - NOT USED HERE. UPDATE THE EXEC GIT ACTIONS BELOW WITH VERSION
27
28 env:
29   LC_ALL: en_US.UTF-8
30   LANG: en_US.UTF-8
31   LANGUAGE: en_US.UTF-8
32   EMBER_CLI_PROD_ASSETS: 1
33   DISCOURSE_FORCE_HTTPS: true
34
35   ## How many concurrent web requests are supported? Depends on memory and CPU cores.
36   ## will be set automatically by bootstrap based on detected CPUs, or you can override
37   UNICORN_WORKERS: <%= node.cpu_cores %>
38
39   ## TODO: The domain name this Discourse instance will respond to
40   DISCOURSE_HOSTNAME: community.openstreetmap.org
41   DISCOURSE_CDN_URL: https://community-cdn.openstreetmap.org
42
43   ## Uncomment if you want the container to be started with the same
44   ## hostname (-h option) as specified above (default "$hostname-$config")
45   #DOCKER_USE_HOSTNAME: true
46
47   ## TODO: List of comma delimited emails that will be made admin and developer
48   ## on initial signup example 'user1@example.com,user2@example.com'
49   DISCOURSE_DEVELOPER_EMAILS: 'operations@openstreetmap.org'
50
51   DISCOURSE_SMTP_ADDRESS: <%= node[:exim][:smarthost_via].split(":", 2)[0] %>
52   DISCOURSE_SMTP_PORT: <%= node[:exim][:smarthost_via].split(":", 2)[1] || "25" %>
53   DISCOURSE_SMTP_OPENSSL_VERIFY_MODE: none
54   DISCOURSE_SMTP_USER_NAME:
55   DISCOURSE_SMTP_PASSWORD:
56   DISCOURSE_SMTP_DOMAIN: community.openstreetmap.org
57   DISCOURSE_NOTIFICATION_EMAIL: community@noreply.openstreetmap.org
58
59   ## TODO: configure connectivity to the databases
60   DISCOURSE_DB_SOCKET: ''
61   #DISCOURSE_DB_USERNAME: discourse
62   DISCOURSE_DB_PASSWORD: '<%= @passwords["database"] %>'
63   DISCOURSE_DB_HOST: data
64   DISCOURSE_REDIS_HOST: data
65
66   ## The maxmind geolocation IP address key for IP address lookup
67   ## see https://meta.discourse.org/t/-/137387/23 for details
68 <% if @license_keys -%>
69   DISCOURSE_MAXMIND_LICENSE_KEY: '<%= @license_keys[node[:geoipupdate][:account]] %>'
70 <% end -%>
71
72 volumes:
73   - volume:
74       host: /srv/community.openstreetmap.org/shared/web-only
75       guest: /shared
76   - volume:
77       host: /srv/community.openstreetmap.org/shared/web-only/log/var-log
78       guest: /var/log
79   - volume:
80       host: /etc/ssl/certs/community.openstreetmap.org.pem
81       guest: /shared/ssl/ssl.crt
82   - volume:
83       host: /etc/ssl/private/community.openstreetmap.org.key
84       guest: /shared/ssl/ssl.key
85
86 ## Plugins go here
87 ## see https://meta.discourse.org/t/19157 for details
88 hooks:
89   after_code:
90     - exec:
91         cd: $home/plugins
92         cmd:
93           - git clone --depth 1 https://github.com/discourse/discourse-oauth2-basic.git
94           - git clone --depth 1 https://github.com/discourse/discourse-solved.git
95           - git clone --depth 1 https://github.com/discourse/discourse-canned-replies.git
96           - git clone --depth 1 https://github.com/discourse/discourse-reactions.git
97           - git clone --depth 1 https://github.com/discourse/discourse-prometheus.git
98           - git clone --depth 1 https://github.com/discourse/discourse-translator.git
99     - exec:
100         cd: $home
101         cmd:
102           - git fetch --depth=1 origin tag v2.8.13 --no-tags
103           - git checkout v2.8.13
104   after_ssl:
105     - replace:
106         filename: "/etc/nginx/conf.d/discourse.conf"
107         from: /listen 80;/
108         to: |
109           listen 80;
110           rewrite ^/\.well-known/acme-challenge/(.*)$ http://acme.openstreetmap.org/.well-known/acme-challenge/$1 permanent;
111
112     - replace:
113         filename: "/etc/nginx/conf.d/discourse.conf"
114         from: /add_header.+/
115         to: |
116           add_header Strict-Transport-Security 'max-age=63072000';