-
Notifications
You must be signed in to change notification settings - Fork 0
/
staging-nginx-ssl.yml
76 lines (67 loc) · 1.61 KB
/
staging-nginx-ssl.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
75
76
version: "3"
volumes:
app_postgres_data: { }
services:
django: &django
build:
context: .
dockerfile: ./compose/Dockerfile-django
depends_on:
- postgres
volumes:
- .:/app:z
env_file:
- ./.envs/.staging
ports:
- "8000:8000"
command: /scripts/start-django-staging
postgres:
image: "postgres:12.3"
volumes:
- app_postgres_data:/var/lib/postgresql/data:Z
env_file:
- ./.envs/.staging
ports:
- "5432:5432"
redis:
image: redis:5.0
celeryworker:
<<: *django
depends_on:
- redis
- postgres
ports: [ ]
command: /scripts/start-celeryworker
celerybeat:
<<: *django
depends_on:
- redis
- postgres
ports: [ ]
command: /scripts/start-celerybeat
celeryflower:
<<: *django
ports:
- "5555:5555"
command: /scripts/start-celeryflower
nginx:
image: nginx:1.17.4-alpine
restart: unless-stopped
volumes:
- .:/app
- ./compose/certbot/conf:/etc/letsencrypt
- ./compose/certbot/www:/var/www/certbot
- ./compose/nginx/docker-nginx-ssl.conf:/etc/nginx/conf.d/default.conf
ports:
- "443:443"
- "80:80"
depends_on:
- django
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
certbot:
image: certbot/certbot:v0.36.0
restart: unless-stopped
volumes:
- ./compose/certbot/conf:/etc/letsencrypt
- ./compose/certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 5d & wait $${!}; done;'"