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