docker-compose

This commit is contained in:
2019-10-31 22:37:04 +01:00
parent 14b83949e0
commit a8afb8882d
13 changed files with 146 additions and 37 deletions

30
docker-compose.yml Normal file
View File

@@ -0,0 +1,30 @@
version: '3.7'
services:
nginx:
container-name: nginx
image: nginx:latest
ports:
- "80:80"
- "443:443"
volumes:
- ./data/nginx:/etc/nginx/conf.d
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
certbot:
image: certbot/certbot
volumes:
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
app:
build:
context: ./
dockerfile: Dockerfile
image: personal_api:0.0.1
container_name: personal_api
volumes:
- ./:/personal_api/
command: gunicorn -w 4 -k uvicorn.workers.UvicornWorker personal_api.main:app -b 0.0.0.0
ports:
- "8000:8000"