-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.prod.yml
131 lines (131 loc) · 3.48 KB
/
docker-compose.prod.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
services:
app:
depends_on:
- redis
- celerybeat
env_file:
- .env
environment:
- TZ=America/New_York
# https://www.digitalocean.com/community/tutorials/how-to-secure-a-containerized-node-js-application-with-nginx-let-s-encrypt-and-docker-compose
flower:
image: mher/flower
container_name: "flower"
expose:
- "8888"
environment:
- CELERY_BROKER_URL=redis://redis
- FLOWER_PORT=8888
- TZ=America/New_York
networks:
- network1
- nginx_network
depends_on:
- redis
logging:
options:
max-size: "10m"
max-file: "3"
command: sh -c "apk add --no-cache tzdata && cp /usr/share/zoneinfo/America/New_York /etc/localtime && echo 'America/New_York' > /etc/timezone && apk del tzdata"
nginx:
restart: always
ports:
- "0.0.0.0:80:80"
- "0.0.0.0:443:443"
- "8888:8888"
volumes:
- ./nginx:/app/nginx
- ./nginx/certbot/conf:/etc/letsencrypt
- ./nginx/certbot/www:/var/www/certbot
- ../anhd-council-client/build_publish:/client
- ../staging-anhd-council-client/build_publish:/staging-client
- static_volume:/static
environment:
- TZ=America/New_York
depends_on:
- app
- flower
networks:
- nginx_network
command: '/bin/sh -c ''while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g "daemon off;"'''
celery_default:
restart: always
build: .
container_name: "celery_default"
image: app_image
networks:
- network1
links:
- redis
depends_on:
- redis
- celerybeat
volumes:
- ./:/app
- ./data:/app/data
- ./logs:/app/logs
- ./celery:/app/celery
env_file:
- .env
entrypoint: "celery -A app worker -E -Q celery -l debug -n celery_worker --concurrency=8 --logfile=./celery/logs/default.log"
environment:
- TZ=America/New_York
logging:
options:
max-size: "10m"
max-file: "3"
celery_update:
restart: always
build: .
container_name: "celery_update"
image: app_image
networks:
- network1
depends_on:
- redis
- celerybeat
volumes:
- ./:/app
- ./data:/app/data
- ./logs:/app/logs
- ./celery/logs:/app/celery/logs
links:
- redis
env_file:
- .env
environment:
- TZ=America/New_York
entrypoint: "celery -A app worker -E -Q update -l debug -n update_worker --concurrency=8 --logfile=./celery/logs/update.log"
logging:
options:
max-size: "10m"
max-file: "3"
celerybeat:
restart: always
build: .
container_name: "celerybeat"
image: app_image
entrypoint: "celery -A app beat -l debug --scheduler django_celery_beat.schedulers:DatabaseScheduler --logfile=./celery/logs/beat.log"
networks:
- network1
depends_on:
- redis
links:
- redis
environment:
- TZ=America/New_York
volumes:
- ./:/app
- ./celery:/app/celery
env_file:
- .env
# https://www.distributedpython.com/2018/10/13/flower-docker/
logging:
options:
max-size: "10m"
max-file: "3"
certbot:
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
environment:
- TZ=America/New_York
command: sh -c "apk add --no-cache tzdata && cp /usr/share/zoneinfo/America/New_York /etc/localtime && echo 'America/New_York' > /etc/timezone && apk del tzdata"