-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.yml
203 lines (193 loc) · 4.24 KB
/
docker-compose.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
195
196
197
198
199
200
201
202
203
services:
db:
image: postgres
restart: unless-stopped
env_file:
- '.env'
environment:
- PGUSER=${POSTGRES_USER}
ports:
- '127.0.0.1:${POSTGRES_PORT}:5432'
volumes:
- './.data/postgres:/var/lib/postgresql/data'
networks:
- titanic
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 4s
timeout: 5s
retries: 15
migrations:
image: migrate/migrate
restart: no
depends_on:
db:
condition: service_healthy
volumes:
- './migrations:/migrations'
networks:
- titanic
links:
- db:db
command: -path=/migrations/ -database postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_USER}?sslmode=disable up
cache:
image: redis:7.2-rc
restart: unless-stopped
ports:
- '127.0.0.1:${REDIS_PORT}:6379'
command: redis-server --save 20 1
networks:
- titanic
volumes:
- './.data/redis:/var/lib/postgresql/data'
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
anchor:
build: ./bancho
restart: unless-stopped
env_file:
- '.env'
environment:
- POSTGRES_HOST=db
- REDIS_HOST=cache
- BANCHO_HTTP_PORT=80
networks:
- titanic
links:
- db:db
- cache:cache
ports:
# Uncomment to access http bancho from outside
# - 127.0.0.1:5050:80
- 13381:13381
- 13382:13382
- 13383:13383
- 13384:13384
volumes:
- './.data:/bancho/.data'
- './.data/logs/bancho:/bancho/logs'
depends_on:
db:
condition: service_healthy
cache:
condition: service_healthy
deck:
build: ./web/deck
restart: unless-stopped
env_file:
- '.env'
environment:
- POSTGRES_HOST=db
- REDIS_HOST=cache
- OSZ2_SERVICE_URL=http://osz2-service:8080
networks:
- titanic
links:
- db:db
- cache:cache
- osz2-service:osz2-service
# ports:
# Uncomment to access deck from outside
# - 127.0.0.1:6060:80
volumes:
- './.data:/deck/.data'
- './.data/logs/deck:/deck/logs'
depends_on:
db:
condition: service_healthy
cache:
condition: service_healthy
bot:
build: ./bot
restart: on-failure
env_file:
- '.env'
environment:
- POSTGRES_HOST=db
- REDIS_HOST=cache
networks:
- titanic
links:
- db:db
- cache:cache
volumes:
- './.data:/bot/.data'
- './.data/logs/bot:/bot/logs'
depends_on:
db:
condition: service_healthy
cache:
condition: service_healthy
stern:
build: ./web/stern
restart: unless-stopped
env_file:
- '.env'
environment:
- POSTGRES_HOST=db
- REDIS_HOST=cache
networks:
- titanic
links:
- db:db
- cache:cache
# ports:
# Uncomment to access stern from outside
# - 127.0.0.1:7070:80
volumes:
- './.data/logs/stern:/stern/logs'
- './.data:/stern/.data'
depends_on:
db:
condition: service_healthy
cache:
condition: service_healthy
nginx:
image: nginx:latest
restart: unless-stopped
env_file:
- '.env'
environment:
- DOLLAR=$$
ports:
- "${NGINX_HOST}:${NGINX_PORT}:80"
networks:
- titanic
links:
- anchor:anchor
- deck:deck
- stern:stern
volumes:
- './web/nginx/templates:/etc/nginx/templates'
- './web/nginx/nginx.conf:/etc/nginx/nginx.conf'
command: /bin/bash -c "envsubst < /etc/nginx/templates/default.conf.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
jobs:
build: ./jobs
restart: unless-stopped
env_file:
- '.env'
environment:
- POSTGRES_HOST=db
- REDIS_HOST=cache
links:
- db:db
- cache:cache
networks:
- titanic
depends_on:
db:
condition: service_healthy
cache:
condition: service_healthy
entrypoint: python3 main.py --file ./schedule.prod.json
osz2-service:
build: ./web/osz2-service
restart: unless-stopped
networks:
- titanic
networks:
titanic:
driver: bridge