-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathdocker-compose.yaml
77 lines (77 loc) · 1.72 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
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
version: '2'
services:
nginx:
build: ./nginx
networks:
- backend
- frontend
ports:
- "80:80"
links:
- daphne
depends_on:
- daphne
- worker
environment:
DAPHNE_HOST: daphne
volumes_from:
- daphne
postgres:
image: postgres
environment:
- POSTGRES_USER=cnluser
- POSTGRES_PASSWORD=temporary
- POSTGRES_DB=codingnightlive
volumes:
- ./postgres:/docker-entrypoint-initdb.d:ro # Read ./postgres/*.sh and run it as initializing steps.
- ./postgres_db:/var/lib/postgresql/data:rw # ./postgres_db will be used as database.
ports:
- "5432:5432" # for SANDBOX
networks:
- backend
redis:
image: redis
networks:
- backend
ports:
- "6379:6379" # for SANDBOX
worker:
build: .
working_dir: /opt/coding-night-live
command: bash -c "python manage.py runworker"
environment:
- REDIS_HOST=redis
- POSTGRES_HOST=postgres
networks:
- frontend
- backend
depends_on:
- redis
- postgres
links:
- redis
- postgres
daphne:
build: .
working_dir: /opt/coding-night-live
command: bash -c "daphne -b 0.0.0.0 -p 8000 coding_night_live.asgi:channel_layer"
ports:
- "8000:8000" # for SANDBOX
environment:
- REDIS_HOST=redis
- POSTGRES_HOST=postgres
- IS_HTTPS_IN_FRONT_OF_NGINX=False # for SANDBOX, if not True.
networks:
- frontend
- backend
depends_on:
- redis
- postgres
links:
- redis
- postgres
volumes:
- /opt/coding-night-live/collected_static
networks:
frontend: # exposed
backend: # not exposed (DO NOT OPEN THESE PORTS)