-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
50 lines (49 loc) · 1.18 KB
/
docker-compose.yaml
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
volumes:
static:
services:
nginx:
image: nginx:latest
restart: unless-stopped
volumes:
- ./nginx:/etc/nginx/conf.d
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
- static:/app/static
ports:
- 80:80
- 443:443
command: '/bin/sh -c ''while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g "daemon off;"'''
depends_on:
- app
certbot:
image: certbot/certbot
restart: unless-stopped
volumes:
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
app:
build: .
depends_on:
- cache
working_dir: /app/src
command: python -m gunicorn -c python:config.gunicorn config.wsgi
environment:
REDIS_URL: redis://cache:6379
env_file:
- .env
ports:
- 8000:8000
volumes:
- static:/app/static
healthcheck:
test: curl localhost:8000/up
interval: "120s"
timeout: "3s"
start_period: "5s"
retries: 3
cache:
restart: unless-stopped
image: redis:latest
ports:
- 6379:6379