-
Notifications
You must be signed in to change notification settings - Fork 7
/
docker-compose.yml
107 lines (104 loc) · 2.67 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
services:
db:
image: mariadb:10.8
restart: always
ports:
- 3306:3306
volumes:
- tosurnament-data:/var/lib/mysql
- ./tosurnament.sql:/docker-entrypoint-initdb.d/tosurnament.sql
- ./tosurnament_message.sql:/docker-entrypoint-initdb.d/tosurnament_message.sql
- ./init_mysql.sh:/docker-entrypoint-initdb.d/init_mysql.sh
env_file:
- .env
- .env.production
- .env.production.secret
environment:
MARIADB_MYSQL_LOCALHOST_USER: "true"
healthcheck:
test: healthfile=$$(find /tmp/health.txt -not -newermt "-10 seconds"); if [ $$? != 0 ] || [ $$healthfile ]; then /usr/local/bin/healthcheck.sh --su-mysql --connect --innodb_initialized && touch /tmp/health.txt; fi
interval: 1s
timeout: 1s
retries: 3
start_period: 10s
api:
restart: always
build:
context: .
dockerfile: Dockerfile.api
ports:
- 5001:5001
volumes:
- ./backend/api:/app/api
- ./backend/common:/app/common
- ./backend/start_api.py:/app/start_api.py
- ./logs:/app/logs
env_file:
- .env
- .env.production
- .env.production.secret
environment:
MYSQL_HOST: db
depends_on:
db:
condition: service_healthy
command: gunicorn -b 0.0.0.0:5001 -w 1 start_api:app --access-logfile /app/logs/api.log --access-logformat '"%(r)s" - %(s)s'
bot:
restart: always
build:
context: .
dockerfile: Dockerfile.bot
volumes:
- ./backend/bot:/app/bot
- ./backend/common:/app/common
- ./backend/start_bot.py:/app/start_bot.py
- ./logs:/app/logs
env_file:
- .env
- .env.production
- .env.production.secret
environment:
MYSQL_HOST: db
TOSURNAMENT_API_HOST: api
depends_on:
- "api"
command: python3 start_bot.py
dashboard:
restart: always
build:
context: .
dockerfile: Dockerfile.dashboard
ports:
- 3000:3000
volumes:
- tosurnament-dashboard-node-modules:/app/dashboard/node_modules/
env_file:
- .env
- .env.production
- .env.production.secret
depends_on:
- "api"
command: yarn start
auth:
restart: always
build:
context: .
dockerfile: Dockerfile.auth
ports:
- 3001:3001
volumes:
- tosurnament-auth-node-modules:/app/node_modules/
env_file:
- .env
- .env.production
- .env.production.secret
environment:
HOST: 0.0.0.0
PRIVATE_TOSURNAMENT_API_PATH: "http://api:5001/api/v1"
depends_on:
- "api"
command: yarn start
volumes:
tosurnament-data:
tosurnament-dashboard-node-modules:
tosurnament-auth-node-modules: