-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdocker-compose.yml
94 lines (87 loc) · 2.38 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
version: '3'
services:
db:
image: postgres:12.1-alpine
command: postgres -c 'max_connections=200'
expose:
- "5432"
ports:
- "5432:5432"
volumes:
- ./docker-volumes/db:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
redis:
image: redis:5.0.7-alpine
expose:
- "6379"
volumes:
- ./docker-volumes/redis:/data
frontend:
build:
context: '.'
dockerfile: application/Dockerfile
entrypoint: sh -c 'python3 database.py; gunicorn --bind 0.0.0.0:5000 -w 32 --timeout 120 --access-logfile - --error-logfile - wsgi'
environment:
- MODEL_DIR=/data
- REDIS_HOST=redis
- POSTGRES_HOST=db
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- TESTING=${TESTING}
- CLIENT_ID=${CLIENT_ID}
- CLIENT_SECRET=${CLIENT_SECRET}
- SERVER_NAME=${SERVER_NAME}
- MG_KEY=${MG_KEY}
- MG_EMAIL=${MG_EMAIL}
- DEV_EMAIL=${DEV_EMAIL}
- ADMIN_EMAIL=${ADMIN_EMAIL}
- CONTACT_EMAIL=${CONTACT_EMAIL}
- CRYPTOGRAPHY_DONT_BUILD_RUST=1
- SECRET_KEY=${SECRET_KEY}
expose:
- "5000"
depends_on:
- redis
- db
volumes:
- ./models:/data
nginx:
build: ui
depends_on:
- frontend
ports:
- "80:80"
- "443:443"
volumes:
- ./docker-volumes/certbot/conf:/etc/letsencrypt
- ./docker-volumes/certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c \"nginx -g 'daemon off;' & while true; do nginx -t && nginx -s reload; sleep 1h; done\""
certbot:
ports: []
image: certbot/certbot
volumes:
- ./docker-volumes/certbot/conf:/etc/letsencrypt
- ./docker-volumes/certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit INT TERM; while true; do certbot renew --webroot -w /var/www/certbot; sleep 12h; done'"
worker:
build:
context: '.'
dockerfile: application/Dockerfile
entrypoint: supervisord -n
environment:
- MODEL_DIR=/data
- REDIS_HOST=redis
- POSTGRES_HOST=db
- NUM_WORKERS=2
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- SERVER_NAME=${SERVER_NAME}
- MG_KEY=${MG_KEY}
- MG_EMAIL=${MG_EMAIL}
- DEV_EMAIL=${DEV_EMAIL}
- ADMIN_EMAIL=${ADMIN_EMAIL}
- CONTACT_EMAIL=${CONTACT_EMAIL}
depends_on:
- redis
- db
volumes:
- ./models:/data