-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-prod.yml
96 lines (87 loc) · 1.76 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
version: '3'
services:
db:
restart: unless-stopped
image: postgres
env_file:
- .env
ports:
- "5432:5432"
volumes:
- db_data:/var/lib/postgresql/data
redis:
image: "redis:4"
restart: unless-stopped
hostname: redis
expose:
- "6379"
rabbit:
hostname: rabbit
restart: unless-stopped
image: rabbitmq:3-management
env_file:
- .env
expose:
- "5672" # we forward this port because it's useful for debugging
- "15672" # here, we can access rabbitmq management plugin
backend: &backend
restart: unless-stopped
build:
context: ./backend
dockerfile: Dockerfile.backend
volumes:
- ./backend:/code
- static:/static
expose:
- "8000"
env_file:
- .env.prod
command: ["/code/wait-for-postgres.sh", "db", "/code/init.sh"]
depends_on:
- db
- rabbit
- redis
celery:
restart: unless-stopped
<<: *backend
volumes:
- ./backend:/code
env_file:
- .env.prod
command: ["/code/wait-for-postgres.sh", "db", "/code/run-celery.sh"]
depends_on:
- db
- rabbit
- redis
tty: true
daphne:
<<: *backend
command: ["/code/wait-for-postgres.sh", "db", "/code/start-daphne.sh"]
expose:
- "8001"
depends_on:
- db
- redis
worker:
<<: *backend
command: ["/code/wait-for-postgres.sh", "db", "/code/start-worker.sh"]
depends_on:
- db
- redis
nginx:
restart: unless-stopped
container_name: nginx_server
build:
context: ./nginx/
dockerfile: Dockerfile
depends_on:
- backend
- daphne
- worker
volumes:
- static:/static
ports:
- "0.0.0.0:80:80"
volumes:
db_data:
static: