-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.dev.yml
115 lines (105 loc) · 2.67 KB
/
docker-compose.dev.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
version: '3.4'
x-web-variables: &web-variables
DJANGO_SETTINGS_MODULE: lolmd.settings.dev
SECRET_KEY: ${SECRET_KEY:-Keep_it_secret,_keep_it_safe}
RIOT_API_KEY: ${RIOT_API_KEY}
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_NAME: lolmd
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
HEARTBEAT_RATE: 60
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_PASSWORD: ${REDIS_PASSWORD:-redis}
ADMIN_PASSWORD: ${ADMIN_PASSWORD:-creme}
services:
postgres:
restart: always
image: postgres:11.3
environment:
- POSTGRES_HOST=postgres
- POSTGRES_DB=lolmd
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- PGDATA=/var/lib/postgresql/data/
volumes:
- postgres_data:/var/lib/postgresql/data/
ports:
- "5432:5432"
redis:
image: redis:5.0.5
environment:
- REDIS_PASSWORD=${REDIS_PASSWORD:-redis}
volumes:
- redisdata:/data
ports:
- "6379:6379"
command: >
--requirepass $REDIS_PASSWORD
web:
restart: always
build: ./web/
environment: *web-variables
command: >
bash -c "python manage.py makemigrations core
&& python manage.py migrate --noinput
&& python manage.py flush --noinput
&& python manage.py flush_redis
&& python manage.py add_regions
&& python manage.py add_models
&& python manage.py add_admins
&& python manage.py prune_matches
&& python manage.py flush_redis
&& python manage.py collectstatic --noinput
&& python manage.py queue_random_matches
&& /usr/local/bin/gunicorn lolmd.wsgi:application -w 2 -b :8000"
volumes:
- /static:/static
- .:/code
ports:
- "8000"
depends_on:
- postgres
- redis
nginx:
restart: always
build: ./nginx/
ports:
- "80:80"
volumes:
- /static:/static
links:
- web:web
rqworker:
restart: always
build: ./web/
environment: *web-variables
command: bash wait-for-it.sh web:8000 -t 0 -- python manage.py rqworker default
depends_on:
- web
rqscheduler:
restart: always
build: ./web/
environment: *web-variables
command: bash wait-for-it.sh web:8000 -t 0 -- python manage.py rqscheduler --interval 60
depends_on:
- web
redis-commander:
restart: always
image: rediscommander/redis-commander
ports:
- "8082:8082"
links:
- redis:redis
environment:
- REDIS_HOST=redis
- REDIS_PORT=6379
- REDIS_PASSWORD=${REDIS_PASSWORD:-redis}
- PORT=8082
depends_on:
- redis
volumes:
web-static:
postgres_data:
redisdata: