-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
49 lines (43 loc) · 1.04 KB
/
docker-compose.yaml
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
services:
nginx:
image: nginx:alpine
restart: unless-stopped
ports:
- 80:80
- 443:443
volumes:
- ./nginx:/etc/nginx/conf.d
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
- ./static_collected:/var/html/static/
- ./media:/var/html/media
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
depends_on:
- web
certbot:
image: certbot/certbot
restart: unless-stopped
volumes:
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
db:
image: postgres:14.2-alpine
volumes:
- postgres-data:/var/lib/postgresql/data
env_file:
- .env
web:
build: .
restart: always
ports:
- 8000:8000
env_file:
- .env
volumes:
- ./static:/static_collected/
- ./media:/media/
volumes:
postgres-data:
static:
media: