-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.letsencrypt.yml
185 lines (176 loc) · 5.97 KB
/
docker-compose.letsencrypt.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
x-climweb-variables: &climweb-variables
WAIT_TIMEOUT: 120
GUNICORN_NUM_OF_WORKERS: ${CMS_NUM_OF_WORKERS:-4}
GUNICORN_TIMEOUT: ${CMS_GUNICORN_TIMEOUT:-300}
DEBUG: ${CMS_DEBUG}
WAGTAIL_SITE_NAME: ${CMS_SITE_NAME}
ADMIN_URL_PATH: ${CMS_ADMIN_URL_PATH}
TIME_ZONE: ${TIME_ZONE}
SECRET_KEY: ${SECRET_KEY}
ALLOWED_HOSTS: ${ALLOWED_HOSTS}
CSRF_TRUSTED_ORIGINS: ${CSRF_TRUSTED_ORIGINS}
DATABASE_URL: postgis://${CMS_DB_USER}:${CMS_DB_PASSWORD}@climweb_db:5432/${CMS_DB_NAME}
REDIS_URL: redis://climweb_redis:6379/0
EMAIL_HOST: ${SMTP_EMAIL_HOST}
EMAIL_PORT: ${SMTP_EMAIL_PORT}
EMAIL_USE_TLS: ${SMTP_EMAIL_USE_TLS}
EMAIL_HOST_USER: ${SMTP_EMAIL_HOST_USER}
EMAIL_HOST_PASSWORD: ${SMTP_EMAIL_HOST_PASSWORD}
DJANGO_ADMINS: ${CMS_ADMINS}
DEFAULT_FROM_EMAIL: ${DEFAULT_FROM_EMAIL}
RECAPTCHA_PUBLIC_KEY: ${RECAPTCHA_PUBLIC_KEY}
RECAPTCHA_PRIVATE_KEY: ${RECAPTCHA_PRIVATE_KEY}
RECAPTCHA_DOMAIN: ${RECAPTCHA_DOMAIN:-www.google.com}
RECAPTCHA_VERIFY_REQUEST_TIMEOUT: ${RECAPTCHA_VERIFY_REQUEST_TIMEOUT:-60}
NEXTJS_SERVER_URL: http://climweb_mapviewer:3000
CMS_UPGRADE_HOOK_URL: ${CMS_UPGRADE_HOOK_URL}
WAGTAILADMIN_BASE_URL: ${CMS_BASE_URL}
LANGUAGE_CODE: ${CMS_DEFAULT_LANGUAGE_CODE}
MBGL_RENDERER_URL: http://climweb_mbgl_renderer:80/render
CAP_CERT_PATH: ${CAP_CERT_PATH:-}
CAP_PRIVATE_KEY_PATH: ${CAP_PRIVATE_KEY_PATH:-}
CAP_SIGNATURE_METHOD: ${CAP_SIGNATURE_METHOD:-ECDSA_SHA256}
CAP_MQTT_SECRET_KEY: ${CAP_MQTT_SECRET_KEY:-}
CLIMWEB_ADDITIONAL_APPS: ${CLIMWEB_ADDITIONAL_APPS:-}
CLIMWEB_PLUGIN_DIR: ${CLIMWEB_PLUGIN_DIR:-}
CLIMWEB_PLUGIN_GIT_REPOS: ${CLIMWEB_PLUGIN_GIT_REPOS:-}
CLIMWEB_PLUGIN_URLS: ${CLIMWEB_PLUGIN_URLS:-}
services:
climweb_db:
container_name: climweb_db
image: postgis/postgis:15-master
restart: unless-stopped
environment:
- POSTGRES_USER=${CMS_DB_USER}
- POSTGRES_DB=${CMS_DB_NAME}
- POSTGRES_PASSWORD=${CMS_DB_PASSWORD}
ports:
- "5432"
volumes:
- ${CMS_DB_VOLUME}:/var/lib/postgresql/data/
climweb_redis:
image: redis:alpine
container_name: climweb_redis
restart: unless-stopped
climweb:
image: climweb
container_name: climweb
platform: linux/x86_64
build:
context: ./climweb
dockerfile: Dockerfile
args:
- CLIMWEB_VERSION=${CLIMWEB_VERSION}
- UID=${UID}
- GID=${GID}
restart: unless-stopped
expose:
- 8000
environment:
<<: *climweb-variables
WAIT_HOSTS: climweb_db:5432,climweb_redis:6379
ports:
- "8000"
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- ${CMS_STATIC_VOLUME}:/climweb/web/src/climweb/static
- ${CMS_MEDIA_VOLUME}:/climweb/web/src/climweb/media
- ${BACKUP_VOLUME}:/climweb/web/src/climweb/backup
- ${LETS_ENCRYPT_VOLUME:-./nginx/certbot/conf}:/etc/letsencrypt:ro
climweb_celery_worker:
image: climweb_celery_worker
container_name: climweb_celery_worker
platform: linux/x86_64
build:
context: ./climweb
dockerfile: Dockerfile
args:
- CLIMWEB_VERSION=${CLIMWEB_VERSION}
- UID=${UID}
- GID=${GID}
init: true
command: celery-worker
restart: unless-stopped
environment:
<<: *climweb-variables
WAIT_HOSTS: climweb_db:5432,climweb_redis:6379,climweb:8000
volumes:
- ${CMS_STATIC_VOLUME}:/climweb/web/src/climweb/static
- ${CMS_MEDIA_VOLUME}:/climweb/web/src/climweb/media
- ${BACKUP_VOLUME}:/climweb/web/src/climweb/backup
- ${LETS_ENCRYPT_VOLUME:-./nginx/certbot/conf}:/etc/letsencrypt:ro
climweb_celery_beat:
image: climweb_celery_beat
container_name: climweb_celery_beat
platform: linux/x86_64
build:
context: ./climweb
dockerfile: Dockerfile
args:
- CLIMWEB_VERSION=${CLIMWEB_VERSION}
- UID=${UID}
- GID=${GID}
init: true
command: celery-beat
restart: unless-stopped
environment:
<<: *climweb-variables
WAIT_HOSTS: climweb_db:5432,climweb_redis:6379,climweb:8000
volumes:
- ${CMS_STATIC_VOLUME}:/climweb/web/src/climweb/static
- ${CMS_MEDIA_VOLUME}:/climweb/web/src/climweb/media
- ${BACKUP_VOLUME}:/climweb/web/src/climweb/backup
- ${LETS_ENCRYPT_VOLUME:-./nginx/certbot/conf}:/etc/letsencrypt:ro
climweb_mapviewer:
image: climweb_mapviewer
container_name: climweb_mapviewer
restart: unless-stopped
platform: linux/x86_64
build:
context: ./mapviewer
args:
- CMS_API=${MAPVIEWER_CMS_API}
- BASE_PATH=${MAPVIEWER_BASE_PATH}
- ASSET_PREFIX=${MAPVIEWER_ASSET_PREFIX}
- ANALYTICS_PROPERTY_ID=${ANALYTICS_PROPERTY_ID}
- BITLY_TOKEN=${BITLY_TOKEN}
- GOOGLE_CUSTOM_SEARCH_CX=${GOOGLE_CUSTOM_SEARCH_CX}
- GOOGLE_SEARCH_API_KEY=${GOOGLE_SEARCH_API_KEY}
- NEXT_TELEMETRY_DISABLED=1
volumes:
- ${MAPVIEWER_NEXT_STATIC_VOLUME}:/app/nginx/.next/static
ports:
- "3000"
climweb_mbgl_renderer:
container_name: climweb_mbgl_renderer
build:
context: ./mbgl_renderer
dockerfile: Dockerfile
restart: unless-stopped
ports:
- "80"
nginx:
container_name: nginx
image: nginx:1.27.1-alpine
restart: unless-stopped
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
volumes:
- ${CMS_STATIC_VOLUME}:/wagtail_static
- ${CMS_MEDIA_VOLUME}:/wagtail_media
- ${MAPVIEWER_NEXT_STATIC_VOLUME}:/mapviewer/static
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/ssl:/etc/nginx/ssl
- ./nginx/certbot/conf:/etc/letsencrypt
- ./nginx/certbot/www:/var/www/certbot
ports:
- "80:80"
- "443:443"
certbot:
image: certbot/certbot
container_name: certbot
restart: unless-stopped
volumes:
- ./nginx/certbot/conf:/etc/letsencrypt
- ./nginx/certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"