]> git.openstreetmap.org Git - chef.git/blob - cookbooks/community/templates/default/web_only.yml.erb
community: workaround git tag checkout bug
[chef.git] / cookbooks / community / templates / default / web_only.yml.erb
1 templates:
2   - "templates/web.template.yml"
3   - "templates/web.ratelimited.template.yml"
4   - "templates/web.ssl.template.yml"
5
6 ## which TCP/IP ports should this container expose?
7 ## If you want Discourse to share a port with another webserver like Apache or nginx,
8 ## see https://meta.discourse.org/t/17247 for details
9 expose:
10   - "80:80"   # http
11   - "443:443" # https
12
13 # Use 'links' key to link containers together, aka use Docker --link flag.
14 links:
15   - link:
16       name: data
17       alias: data
18
19 # any extra arguments for Docker?
20 # docker_args:
21
22 # Workaround bug: https://github.com/discourse/discourse_docker/pull/505
23 # params:
24 #  version: v2.8.1
25
26 env:
27   LC_ALL: en_US.UTF-8
28   LANG: en_US.UTF-8
29   LANGUAGE: en_US.UTF-8
30   EMBER_CLI_PROD_ASSETS: 1
31   DISCOURSE_FORCE_HTTPS: true
32
33   ## How many concurrent web requests are supported? Depends on memory and CPU cores.
34   ## will be set automatically by bootstrap based on detected CPUs, or you can override
35   UNICORN_WORKERS: 8
36
37   ## TODO: The domain name this Discourse instance will respond to
38   DISCOURSE_HOSTNAME: community.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   ## TODO: The SMTP mail server used to validate new accounts and send notifications
49   # SMTP ADDRESS, username, and password are required
50   # WARNING the char '#' in SMTP password can cause problems!
51   DISCOURSE_SMTP_ADDRESS: mail.openstreetmap.org
52   DISCOURSE_SMTP_PORT: 26
53   DISCOURSE_SMTP_USER_NAME:
54   DISCOURSE_SMTP_PASSWORD:
55   # DISCOURSE_SMTP_ENABLE_START_TLS: true           # (optional, default true)
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   DISCOURSE_MAXMIND_LICENSE_KEY: '<%= @license_keys[node[:geoipupdate][:account]] %>'
69
70 volumes:
71   - volume:
72       host: /srv/community.openstreetmap.org/shared/web-only
73       guest: /shared
74   - volume:
75       host: /srv/community.openstreetmap.org/shared/web-only/log/var-log
76       guest: /var/log
77   - volume:
78       host: /etc/ssl/certs/community.openstreetmap.org.pem
79       guest: /shared/ssl/ssl.crt;
80   - volume:
81       host: /etc/ssl/private/community.openstreetmap.org.key
82       guest: /shared/ssl/ssl.key;;
83
84 ## Plugins go here
85 ## see https://meta.discourse.org/t/19157 for details
86 hooks:
87   after_code:
88     - exec:
89         cd: $home/plugins
90         cmd:
91           - git clone --depth 1 https://github.com/discourse/docker_manager.git
92           - git clone --depth 1 https://github.com/discourse/discourse-oauth2-basic.git
93           - git clone --depth 1 https://github.com/discourse/discourse-solved.git
94           - git clone --depth 1 https://github.com/discourse/discourse-canned-replies.git
95           - git clone --depth 1 https://github.com/discourse/discourse-reactions.git
96     - exec:
97         cd: $home
98         cmd:
99           - git fetch --depth=1 origin tag v2.8.1 --no-tags
100           - git checkout v2.8.1
101   after_ssl:
102     - file:
103         path: "/etc/nginx/letsencrypt.conf"
104         contents: |
105           user www-data;
106           worker_processes auto;
107           daemon on;
108
109           events {
110             worker_connections 768;
111             # multi_accept on;
112           }
113
114           http {
115             sendfile on;
116             tcp_nopush on;
117             tcp_nodelay on;
118             keepalive_timeout 65;
119             types_hash_max_size 2048;
120
121             access_log /var/log/nginx/access.letsencrypt.log;
122             error_log /var/log/nginx/error.letsencrypt.log;
123
124             server {
125               listen 80;
126               listen [::]:80;
127
128               rewrite ^/\.well-known/acme-challenge/(.*)$ http://acme.openstreetmap.org/.well-known/acme-challenge/$1 permanent;
129
130             }
131           }
132
133     - replace:
134         filename: "/etc/nginx/conf.d/discourse.conf"
135         from: /add_header.+/
136         to: |
137           add_header Strict-Transport-Security 'max-age=63072000';