-
Notifications
You must be signed in to change notification settings - Fork 19
/
docker-compose.beta.yml
194 lines (180 loc) · 5.18 KB
/
docker-compose.beta.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# Steps to set up a new docker-compose machine:
#
# docker-compose run django ./manage.py migrate
# docker-compose run django ./manage.py createsuperuser
# docker-compose up
version: '3'
volumes:
node_modules:
services:
nginx:
image: nginx:alpine
ports:
- 80:80
- 443:443
links:
- "django"
volumes:
- ./etc/nginx/oddslingers-docker-compose.prod.conf:/etc/nginx/nginx.conf
- ./data/certs:/opt/oddslingers.poker/data/certs
- ./core:/opt/oddslingers.poker/core
- ./data/static:/opt/oddslingers.poker/data/static
postgres:
image: postgres:13
env_file:
- ./env/beta-docker.env
- .secrets-prod.env
#ports:
# - 5432:5432
expose:
- 5432
command: postgres -c shared_buffers=1GB
volumes:
- ./database/postgres:/var/lib/postgresql/data
redis:
image: redis:5-alpine
entrypoint: redis-server --appendonly yes
expose:
- 6379
volumes:
- ./data/redis:/data
django:
build: .
image: oddslingers:django_base
hostname: oddslingers-prod
working_dir: /opt/oddslingers.poker/core/
command: daphne -b 0.0.0.0 -p 8000 oddslingers.asgi:channel_layer
stdin_open: true
tty: true
depends_on:
- postgres
- redis
environment:
ODDSLINGERS_ENV: PROD
POSTGRES_HOST: postgres
REDIS_HOST: redis
DJANGO_SETTINGS_MODULE: "oddslingers.settings"
IS_DOCKER: 1
env_file:
- ./env/beta-docker.env
- ./.secrets-prod.env
expose:
- 8000
volumes:
- ./data:/opt/oddslingers.poker/data
- ./core:/opt/oddslingers.poker/core
- ./bin:/opt/oddslingers.poker/bin
- ./env:/opt/oddslingers.poker/env
worker:
image: oddslingers:django_base
working_dir: /opt/oddslingers.poker/core/
entrypoint: /opt/oddslingers.poker/bin/worker-docker-entrypoint.sh
user: root
depends_on:
- postgres
- redis
environment:
ODDSLINGERS_ENV: PROD
POSTGRES_HOST: postgres
REDIS_HOST: redis
DJANGO_SETTINGS_MODULE: "oddslingers.settings"
IS_DOCKER: 1
env_file:
- ./env/beta-docker.env
- ./.secrets-prod.env
volumes:
- ./data:/opt/oddslingers.poker/data
- ./data/logs:/var/log/supervisor
- ./core:/opt/oddslingers.poker/core
- ./bin:/opt/oddslingers.poker/bin
- ./env:/opt/oddslingers.poker/env
- ./etc/supervisor/oddslingers-docker-prod-worker.conf:/etc/supervisor/conf.d/supervisord.conf
botbeat:
image: oddslingers:django_base
working_dir: /opt/oddslingers.poker/core/
command: ./manage.py bot_heartbeat
depends_on:
- postgres
- redis
environment:
ODDSLINGERS_ENV: PROD
POSTGRES_HOST: postgres
REDIS_HOST: redis
DJANGO_SETTINGS_MODULE: "oddslingers.settings"
IS_DOCKER: 1
restart: on-failure
env_file:
- ./env/beta-docker.env
- ./.secrets-prod.env
volumes:
- ./data:/opt/oddslingers.poker/data
- ./core:/opt/oddslingers.poker/core
- ./bin:/opt/oddslingers.poker/bin
- ./env:/opt/oddslingers.poker/env
webpack:
build:
context: .
dockerfile: ./Dockerfile.webpack
image: oddslingers:webpack
command: sh -c "(webpack --mode development --watch --info-verbosity verbose & node-sass-chokidar --watch scss/ -o ../static/css 2>&1 &)| cat"
stdin_open: true
tty: true
environment:
ODDSLINGERS_ENV: DEV
volumes:
- ./core/js:/opt/oddslingers.poker/core/js
- ./core/static:/opt/oddslingers.poker/core/static
# Hide local node_modules
- ./core/js/node_modules:/src/node_modules
# Add dumps for UI tests
- ./core/dumps:/opt/oddslingers.poker/core/dumps
dramatiq:
image: oddslingers:django_base
working_dir: /opt/oddslingers.poker/core/
command: nice -15 ./manage.py rundramatiq --processes 1 --threads 1
environment:
ODDSLINGERS_ENV: PROD
POSTGRES_HOST: postgres
REDIS_HOST: redis
cap_add:
- SYS_NICE
depends_on:
- redis
- postgres
env_file:
- ./env/beta-docker.env
- ./.secrets-prod.env
volumes:
- ./data:/opt/oddslingers.poker/data
- ./core:/opt/oddslingers.poker/core
- ./bin:/opt/oddslingers.poker/bin
- ./etc:/opt/oddslingers.poker/etc
cloudflare:
image: cloudflare/cloudflared
network_mode: 'service:nginx'
command: tunnel --no-autoupdate --hostname oddslingers-staging.zervice.io http://nginx
depends_on:
- django
volumes:
- ./data/certs/oddslingers.zervice.io.pem:/etc/cloudflared/cert.pem:ro
yacron:
image: oddslingers:django_base
hostname: oddslingers-prod
command: yacron -c /opt/oddslingers.poker/etc/yacron/oddslingers-prod-docker.yaml
environment:
ODDSLINGERS_ENV: PROD
POSTGRES_HOST: postgres
REDIS_HOST: redis
IS_DOCKER: 1
depends_on:
- redis
- postgres
env_file:
- ./env/beta-docker.env
- ./.secrets-prod.env
volumes:
- ./etc:/opt/oddslingers.poker/etc
- ./data:/opt/oddslingers.poker/data
- ./core:/opt/oddslingers.poker/core
- ./etc/yacron:/opt/oddslingers.poker/etc/yacron
- ./bin:/opt/oddslingers.poker/bin