forked from open-formulieren/open-forms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
158 lines (146 loc) · 3.91 KB
/
docker-compose.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
#
# Docker-compose for full Open Form stack.
#
# DISCLAIMER: THIS IS FOR DEVELOPMENT PURPOSES ONLY AND NOT SUITABLE FOR PRODUCTION.
#
# You can use this docker-compose to spin up a local Open Forms stack for demo/try-out
# purposes, or to get some insight in the various components involved (e.g. to build
# your Helm charts from). Note that various environment variables are UNSAFE and merely
# specified so that you can get up and running with the least amount of friction.
#
# Before deploying to production, please review the environment configuration reference:
# https://open-forms.readthedocs.io/en/latest/installation/config.html
#
version: '3.4'
services:
db:
image: postgres:${PG_VERSION:-14}
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
volumes:
- ./docker-init-db.sql:/docker-entrypoint-initdb.d/init_db.sql
- db:/var/lib/postgresql/data
networks:
- open-forms-dev
redis:
image: redis:6
command: ["redis-server", "--appendonly", "yes"]
networks:
- open-forms-dev
volumes:
- data:/data
smtp:
image: namshi/smtp
networks:
- open-forms-dev
clamav:
image: clamav/clamav:1.0.0
networks:
- open-forms-dev
busybox:
image: busybox
command: /bin/chown -R 1000 /private-media
volumes:
- private_media:/private-media
web:
build: &web_build
context: .
args:
RELEASE: ${TAG:-latest}
SDK_RELEASE: ${SDK_TAG:-latest}
image: openformulieren/open-forms:${TAG:-latest}
environment: &web_env
- DJANGO_SETTINGS_MODULE=openforms.conf.docker
- SECRET_KEY=${SECRET_KEY:-@r0w-0(&apjfde5fl6h23!vn)r1ldkp1c_d2#!$$did4z5hun4a}
- DB_NAME=openforms
- DB_USER=openforms
- DB_HOST=db
- CACHE_DEFAULT=redis:6379/0
- CACHE_AXES=redis:6379/0
- CACHE_OIDC=redis:6379/0
- CACHE_PORTALOCKER=redis:6379/0
- ALLOWED_HOSTS=*
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
- CELERY_LOGLEVEL=DEBUG
- OPENFORMS_LOCATION_CLIENT=${OPENFORMS_LOCATION_CLIENT:-openforms.contrib.bag.client.BAGClient}
- CORS_ALLOW_ALL_ORIGINS=${CORS_ALLOW_ALL_ORIGINS:-true}
- EMAIL_HOST=smtp
# Needed for Celery Flower to match the TIME_ZONE configured in the
# settings used by workers and beat containers.
- TZ=Europe/Amsterdam
- CSP_REPORT_ONLY=yes
volumes: &web_volumes
- media:/app/media
- private_media:/app/private_media
- log:/app/log
- certifi_ca_bundle:/app/certifi_ca_bundle
ports:
- 8000:8000
depends_on:
- db
- redis
- smtp
- clamav
networks:
- open-forms-dev
nginx:
image: nginx
volumes:
- ./docker-nginx-default.conf:/etc/nginx/conf.d/default.conf
- private_media:/private-media
ports:
- '9000:80'
depends_on:
- web
networks:
- open-forms-dev
celery:
build: *web_build
image: openformulieren/open-forms:${TAG:-latest}
environment: *web_env
command: /celery_worker.sh
healthcheck:
test: ["CMD", "python", "/app/bin/check_celery_worker_liveness.py"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
volumes: *web_volumes
depends_on:
- db
- redis
networks:
- open-forms-dev
celery-beat:
build: *web_build
image: openformulieren/open-forms:${TAG:-latest}
environment: *web_env
command: /celery_beat.sh
depends_on:
- db
- redis
networks:
- open-forms-dev
celery-flower:
build: *web_build
image: openformulieren/open-forms:${TAG:-latest}
environment: *web_env
command: /celery_flower.sh
ports:
- 5555:5555
depends_on:
- redis
- celery
networks:
- open-forms-dev
volumes:
db:
media:
private_media:
log:
certifi_ca_bundle:
data:
networks:
open-forms-dev:
name: open-forms-dev