-
Notifications
You must be signed in to change notification settings - Fork 1
/
compose.prod.yml
54 lines (48 loc) · 1.08 KB
/
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
services:
db:
expose:
- 5432
web:
build:
target: production
environment:
- "DJANGO_ALLOWED_HOSTS=${MY_DOMAIN}"
- "DJANGO_CSRF_TRUSTED_ORIGINS=https://${MY_DOMAIN}"
- "DJANGO_SESSION_COOKIE_SECURE=1"
- "DJANGO_CSRF_COOKIE_SECURE=1"
- "DJANGO_ENV=production"
restart: unless-stopped
expose:
- 8000
command: ["/code/docker-cmd.sh"]
caddy:
image: caddy:2.7-alpine
env_file: .env
environment:
- "MY_DOMAIN=${MY_DOMAIN}"
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- "./Caddyfile:/etc/caddy/Caddyfile:ro"
- "caddy-data:/data"
- "caddy-config:/config"
- type: volume
source: media-data
target: /usr/share/caddy/media
read_only: true
volume:
nocopy: true
- type: volume
source: staticfiles-data
target: /usr/share/caddy/static
read_only: true
volume:
nocopy: true
volumes:
caddy-data:
caddy-config:
media-data:
postgres-data:
staticfiles-data: