-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
docker-compose.yml
77 lines (72 loc) · 1.98 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
version: '3.9'
volumes:
mysql:
networks:
app:
driver: bridge
services:
bot:
image: node:20.9
working_dir: /app
container_name: mittelbot
restart: unless-stopped
environment:
- TZ=Europe/Berlin
env_file:
- ./.env
volumes:
- .:/app
ports:
- 5000:5000
command: >
sh -c 'if [ "$NODE_ENV" = "development" ]; then
npm install -g nodemon && npm install && npm run alias-build && ls -la /app/bot/core && nodemon ./bot/core/shard.js
else
npm install --omit=dev && npm run alias-build && node bot/core/shard.js
fi'
networks:
- app
mysql:
container_name: mittelbot-mysql
image: mysql:8.2
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=mittelbot
- MYSQL_USER=mittelbot
- MYSQL_PASSWORD=root
- MYSQL_PORT=3306
env_file:
- ./.env
volumes:
- mysql:/var/lib/mysql
ports:
- '3307:3306'
restart: unless-stopped
stdin_open: true
command:
['mysqld', '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci']
healthcheck:
test: ['CMD', 'mysqladmin', 'ping', '-h', 'localhost']
timeout: 5s
retries: 10
networks:
- app
mysql-backup:
image: fradelg/mysql-cron-backup
depends_on:
- mysql
restart: always
volumes:
- ./backups:/backup
environment:
- MYSQL_USER=mittelbot
- MYSQL_PASS=root
- MYSQL_DB=mittelbot
- CRON_TIME=0 0 * * *
- MYSQL_HOST=mysql
- MYSQL_PORT=3306
- TIMEOUT=10s
- INIT_BACKUP=1
- MAX_BACKUPS=7
networks:
- app