-
Notifications
You must be signed in to change notification settings - Fork 1
/
prod-backend.yml
87 lines (85 loc) · 2.03 KB
/
prod-backend.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
version: '3'
volumes:
static_files:
services:
python: &python
# image: python:3.4
image: mertenssander/nictiz_webtools:latest
build:
context: .
dockerfile: docker/prod/python/Dockerfile
environment:
- DJANGO_SETTINGS_MODULE=app.settings.base
- PYTHONUNBUFFERED=1
volumes:
- static_files:/webserver/static_files
command: gunicorn -w 12 -t 120 app.wsgi -b 0.0.0.0:8000
networks:
- webtools
- postgres_network
nginx:
# image: nginx
build:
context: .
dockerfile: docker/prod/nginx/Dockerfile
volumes:
- static_files:/webserver/static_files
links:
- python
expose:
- "${PORT}"
networks:
- webtools
- proxy
environment:
- VIRTUAL_HOST=${DJANGO_DOMAIN}
- VIRTUAL_PORT=${PORT}
- LETSENCRYPT_HOST=${DJANGO_DOMAIN}
- LETSENCRYPT_EMAIL=${EMAIL}
- API_KEY=${AMPLIFY_API_KEY}
- AMPLIFY_IMAGENAME=${AMPLIFY_IMAGENAME}
## RabbitMQ as message queue for Celery
rabbitmq:
image: rabbitmq:3.7-alpine
networks:
- webtools
celery_worker:
# Copy template from service Python
<<: *python
command: celery -A app worker --scheduler django --loglevel=info
ports: []
restart: always
depends_on:
- rabbitmq
networks:
- webtools
- postgres_network
celery_beat:
# Copy template from service Python
<<: *python
command: celery -A app beat --loglevel info --scheduler django_celery_beat.schedulers:DatabaseScheduler
ports: []
restart: always
depends_on:
- rabbitmq
networks:
- webtools
- postgres_network
# GUI for taskmanager Celery
flower:
image: mher/flower
command: ["flower", "--broker=amqp://guest:guest@rabbitmq/", "--port=8888", "--basic_auth=${FLOWER_USER}:${FLOWER_PASSWORD}"]
restart: always
expose:
- "80"
ports:
- 9125:8888
networks:
- webtools
- proxy
networks:
webtools:
postgres_network:
external: true
proxy:
external: true