-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
35 lines (34 loc) · 934 Bytes
/
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
version: "3.8"
services:
api:
build:
dockerfile: Dockerfile
context: ./api
command: gunicorn main:app --bind 0.0.0.0:8000 --worker-class uvicorn.workers.UvicornWorker
expose:
- 8000
env_file:
- ./.env
volumes:
- ${DATABASE_PATH}:${DATABASE_PATH}
nginx:
build:
dockerfile: Dockerfile
context: ./nginx
ports:
- 80:80
- 443:443
depends_on:
- api
command: '/bin/sh -c ''while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g "daemon off;"'''
volumes:
- /etc/letsencrypt:/etc/letsencrypt
- /var/www/certbot:/var/www/certbot
certbot:
build:
dockerfile: Dockerfile
context: ./certbot
volumes:
- /etc/letsencrypt:/etc/letsencrypt
- /var/www/certbot:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew --nginx; sleep 12h & wait $${!}; done;'"