-
Notifications
You must be signed in to change notification settings - Fork 8
/
docker-compose.yml
120 lines (110 loc) · 3.23 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
# Inspired by https://docs.docker.com/compose/django/
version: '3.4'
services:
db:
image: postgres:12-alpine
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
volumes:
- ./docker-init-db.sql:/docker-entrypoint-initdb.d/init_db.sql
- 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
# setup_configuration env vars
- OPENNOTIFICATIES_DOMAIN=web:8000
- OPENNOTIFICATIES_ORGANIZATION=ON
- AUTORISATIES_API_ROOT=https://open-zaak.example.nl/autorisaties/api/v1/
- NOTIF_OPENZAAK_CLIENT_ID=notif-client-id
- NOTIF_OPENZAAK_SECRET=notif-secret
- OPENZAAK_NOTIF_CLIENT_ID=oz-client-id
- OPENZAAK_NOTIF_SECRET=oz-secret
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
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
volumes:
media:
db: