forked from dvk-net/deploy-django-app-postgresql-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
37 lines (36 loc) · 1.21 KB
/
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
36
37
version: "3.9"
services:
nginx:
restart: always
build:
context: ./nginx
ports:
- "80:80" # port exposed to outside world.
- "443:443" # <--- add this line
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
volumes:
- ./persistentdata/certbot/conf:/etc/letsencrypt # <--here
- ./persistentdata/certbot/www:/var/www/certbot
- ./persistentdata/static:/var/www/static
- ./persistentdata/media:/var/www/media
django-backend:
restart: always
build:
context: ./django-backend
image: djangobackend
volumes:
- ./persistentdata/static:/var/www/static # <--here
- ./persistentdata/media:/var/www/media # <--here
postgresql-db:
restart: always
image: postgres
volumes:
- ./persistentdata/db:/var/lib/postgresql/data
env_file:
- ./postgresql-db/.pg-env # why - see the next step
certbot:
image: certbot/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
volumes:
- ./persistentdata/certbot/conf:/etc/letsencrypt # <--here
- ./persistentdata/certbot/www:/var/www/certbot