-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdocker-compose.yml
166 lines (154 loc) · 4.79 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
159
160
161
162
163
164
165
166
# Inspired by https://docs.docker.com/compose/django/
version: '3.4'
services:
db:
image: postgis/postgis:12-2.5
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
volumes:
- ./docker/postgres.entrypoint-initdb.d:/docker-entrypoint-initdb.d:ro
- db:/var/lib/postgresql/data
command: postgres -c max_connections=300 -c log_min_messages=LOG
rabbitmq:
image: rabbitmq:3.9-alpine
redis:
image: redis
web:
build: .
environment: &app-env
- DJANGO_SETTINGS_MODULE=nrc.conf.docker
- SECRET_KEY=${SECRET_KEY:-\(,gc7VE(#CO<zCR3e(lRtOsw5q+U2DpG5o\X#P4PVRm*=u|E%}
- IS_HTTPS=no
- ALLOWED_HOSTS=*
- CACHE_DEFAULT=redis:6379/0
- CACHE_AXES=redis:6379/1
- RABBITMQ_HOST=rabbitmq
- PUBLISH_BROKER_URL=amqp://guest:guest@rabbitmq:5672/%2F
- CELERY_BROKER_URL=amqp://guest:guest@rabbitmq:5672//
- CELERY_RESULT_BACKEND=redis://redis:6379/1
- CELERY_LOGLEVEL=DEBUG
- CELERY_WORKER_CONCURRENCY=${CELERY_WORKER_CONCURRENCY:-4}
- SUBPATH=${SUBPATH:-/}
- OPENNOTIFICATIES_SUPERUSER_USERNAME=admin
- OPENNOTIFICATIES_SUPERUSER_EMAIL=admin@localhost
- DJANGO_SUPERUSER_PASSWORD=admin
healthcheck:
test: ["CMD", "python", "-c", "import requests; exit(requests.head('http://localhost:8000/admin/').status_code not in [200, 302])"]
interval: 30s
timeout: 5s
retries: 3
# This should allow for enough time for migrations to run before the max
# retries have passed. This healthcheck in turn allows other containers
# to wait for the database migrations.
start_period: 30s
ports:
- 8000:8000
volumes: &app-volumes
- media:/app/media # Shared media volume to get access to saved OAS files
- ./docker/setup_configuration:/app/setup_configuration
depends_on:
web-init:
condition: service_completed_successfully
web-init:
build: .
environment: *app-env
command: /setup_configuration.sh
depends_on:
- db
- rabbitmq
- redis
volumes: *app-volumes
celery:
build: .
environment: *app-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: *app-volumes
depends_on:
web:
condition: service_healthy
celery-beat:
build: .
image: openzaak/open-notificaties:${TAG:-latest}
environment: *app-env
command: /celery_beat.sh
volumes: *app-volumes
depends_on:
- db
- rabbitmq
- redis
celery-flower:
build: .
environment: *app-env
command: /celery_flower.sh
ports:
- 5555:5555
depends_on:
- rabbitmq
nginx:
image: nginx
volumes:
- ./docker-nginx-default.conf:/etc/nginx/conf.d/default.conf
ports:
- "9000:80"
depends_on:
- web
openzaak:
image: openzaak/open-zaak:latest
environment: &app-env
- DJANGO_SETTINGS_MODULE=openzaak.conf.docker
- SECRET_KEY=${SECRET_KEY:-7(h1r2hk)8z9+05edulo_3qzymwbo&c24=)qz7+_@3&2sp=u%i}
- DB_NAME=openzaak
- DB_USER=openzaak
- IS_HTTPS=no
- ALLOWED_HOSTS=localhost,127.0.0.1,web,web.local,openzaak
- CORS_ALLOW_ALL_ORIGINS=True
- CSRF_TRUSTED_ORIGINS=http://localhost:9000
- CACHE_DEFAULT=redis:6379/0
- CACHE_AXES=redis:6379/0
- SUBPATH=${SUBPATH:-/}
- IMPORT_DOCUMENTEN_BASE_DIR=${IMPORT_DOCUMENTEN_BASE_DIR:-/app/import-data}
- IMPORT_DOCUMENTEN_BATCH_SIZE=${IMPORT_DOCUMENTEN_BATCH_SIZE:-500}
- OPENZAAK_SUPERUSER_USERNAME=admin
- DJANGO_SUPERUSER_PASSWORD=admin
- OPENZAAK_SUPERUSER_EMAIL=admin@localhost
- CELERY_BROKER_URL=redis://redis:6379/1
- CELERY_RESULT_BACKEND=redis://redis:6379/1
- CELERY_LOGLEVEL=DEBUG
- CELERY_WORKER_CONCURRENCY=${CELERY_WORKER_CONCURRENCY:-4}
- ENVIRONMENT=dev
healthcheck:
test: ["CMD", "python", "-c", "import requests; exit(requests.head('http://localhost:8000/admin/').status_code not in [200, 302])"]
interval: 30s
timeout: 5s
retries: 3
# This should allow for enough time for migrations to run before the max
# retries have passed. This healthcheck in turn allows other containers
# to wait for the database migrations.
start_period: 30s
depends_on:
- db
ports:
- 8001:8000
openzaak_celery:
image: openzaak/open-zaak:latest
environment: *app-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: *app-volumes
depends_on:
openzaak:
condition: service_healthy
volumes:
media:
db: