generated from alexdeathway/headstart-django
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.prod.yml
74 lines (68 loc) · 1.96 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
68
69
70
71
72
73
74
version: "3.8"
volumes:
app_data:
name: lsb_app_data
static_files:
name: lsb_static_files
media_files:
name: lsb_media_files
certbot_web:
name: lsb_certbot_web
certbot_certs:
name: lsb_certbot_certs
services:
django:
build:
context: .
dockerfile: Dockerfile
image: lsb:production
restart: unless-stopped
container_name: lsb_django_production
command: /app/docker/start.sh server
depends_on:
- postgres
env_file:
- .env
ports:
- 8000:8000
volumes:
- static_files:/app/static
- media_files:/app/media
postgres:
image: postgres:13.3-alpine
container_name: lsb_postgres_production
hostname: lsb-postgres
volumes:
- app_data:/var/lib/postgresql/data
env_file:
- .env
nginx:
build:
context: ./nginx
dockerfile: Dockerfile
image: nginx:development
container_name: lsb_nginx_production
ports:
- 80:80
- 443:443
depends_on:
- django
volumes:
- static_files:/app/static:ro
- media_files:/app/media:ro
- certbot_web:/vol/www:ro
- certbot_certs:/etc/letsencrypt/:ro
env_file:
- .env
certbot:
container_name: lsb_certbot_production
build:
context: ./certbot
command: certbot certonly --webroot --webroot-path "/vol/www/" -d "$DOMAIN" --email $EMAIL --rsa-key-size 4096 --agree-tos --noninteractive
depends_on:
- nginx
env_file:
- .env
volumes:
- certbot_web:/vol/www:rw
- certbot_certs:/etc/letsencrypt/:rw