-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose_prod.yml
67 lines (61 loc) · 1.61 KB
/
docker-compose_prod.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
# Docker compose file for production
version: '3.9'
services:
django:
container_name: django
restart: always
build:
context: ./time_tracker
dockerfile: Dockerfile_prod
volumes:
- /var/log/gunicorn:/home/time_tracker/log
- static:/home/time_tracker/static_root # Named volume shared with the nginx container
env_file:
- ./env/prod.env # This file should be built using GitHub secrets
command:
- bash
- -c
- |
python3.10 manage.py migrate
python3.10 manage.py collectstatic --no-input
gunicorn -c gunicorn_conf.py time_tracker.wsgi
nginx:
container_name: nginx
restart: always
build:
context: ./nginx
dockerfile: Dockerfile_prod
volumes:
- /var/log/nginx:/var/log/nginx
- static:/static # Named volume shared with the django container
- ./certbot/www:/var/www/certbot/:ro # Certbot webroot
- ./certbot/conf/:/etc/letsencrypt/:ro # Certbot certificates
ports:
- '80:80'
- '443:443'
depends_on:
- django
certbot:
container_name: certbot
image: certbot/certbot:latest
volumes:
- ./certbot/www/:/var/www/certbot/:rw # Certbot webroot
- ./certbot/conf/:/etc/letsencrypt/:rw # Certbot certificates
command:
- certonly
- --keep-until-expiring
- --webroot
- --webroot-path
- /var/www/certbot
- --agree-tos
- --email
- fxie@timetracker.club
- --no-eff-email
- -d
- www.timetracker.club
- -d
- timetracker.club
depends_on:
- nginx
volumes:
static: