-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathdocker-compose.yml
71 lines (64 loc) · 1.67 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
version: '3'
services:
db:
image: postgres:12.1-alpine
expose:
- "5432"
volumes:
- ./docker-volumes/db:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=postgres
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 --worker-class gevent -w 8 --access-logfile - --error-logfile - wsgi'
environment:
- MODEL_DIR=/data
- REDIS_HOST=redis
- POSTGRES_HOST=db
expose:
- "5000"
depends_on:
- redis
- db
volumes:
- ./models:/data
nginx:
image: nginx:1.17-alpine
depends_on:
- frontend
ports:
- "80:80"
volumes:
- ./nginx:/etc/nginx/conf.d
- ./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
depends_on:
- redis
- db
volumes:
- ./models:/data