-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.prod.yml
executable file
·64 lines (59 loc) · 1.6 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
version: "3"
services:
backend:
image: .
command: gunicorn main.wsgi:application --bind 0.0.0.0:8000 --access-logfile gunicorn.log --error-logfile gunicornerr.log
restart: unless-stopped
volumes:
- ./backend:/usr/src/app
ports:
- "8000:8000"
env_file:
- ./backend/.env
environment:
- DEBUG=0
- GOOGLE_APPLICATION_CREDENTIALS=/usr/src/app/firebase-admin.json
networks:
- app-network
nginx:
image: nginx:latest
ports:
- "80:80"
- "443:443"
restart: unless-stopped
volumes:
- ./web/nginx-proxy.prod.conf:/etc/nginx/conf.d/default.conf
- certbot-etc:/etc/letsencrypt
- certbot-var:/var/lib/letsencrypt
- ./backend/staticfiles:/staticfiles
- ./backend/mediafiles:/mediafiles
# - ./client/dist:/var/www/client # maps frontend build inside web
depends_on:
- backend
networks:
- app-network
environment:
- DOMAIN=${DOMAIN:-example.com}
certbot:
image: certbot/certbot:latest
volumes:
- certbot-etc:/etc/letsencrypt
- certbot-var:/var/lib/letsencrypt
- web-root:/var/www/certbot
depends_on:
- nginx
command: certonly --server https://acme-v02.api.letsencrypt.org/directory --manual --preferred-challenges dns -d ${DOMAIN:-example.com} -d *.${DOMAIN:-example.com}
environment:
- DOMAIN=${DOMAIN:-example.com}
volumes:
certbot-etc:
certbot-var:
web-root:
driver: local
driver_opts:
type: none
device: /home/${USER:-ubuntu}/${REPO_NAME:-app}/
o: bind
networks:
app-network:
driver: bridge