-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
61 lines (59 loc) · 1.69 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
version: "3.8"
networks:
shellbot-net:
driver: bridge
name: shellbot-net
ipam:
config:
- subnet: 172.18.0.0/24
services:
mariadb:
image: mariadb:10.4
container_name: shellbot-mariadb
deploy:
resources:
limits:
cpus: '4'
memory: 4G
reservations:
cpus: '2'
memory: 2G
ports:
- "3306:3306"
networks:
shellbot-net:
ipv4_address: 172.18.0.102
hostname: shellbot-mariadb
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
MYSQL_HOME: /etc/mysql/conf.d
volumes:
- ./docker/mariadb-migrations:/docker-entrypoint-initdb.d
command: mysqld --innodb-file-per-table=0 --innodb-adaptive-hash-index=0
web:
image: liaf/shellbot3000
container_name: shellbot3000
deploy:
resources:
limits:
cpus: '4'
memory: 4G
reservations:
cpus: '2'
memory: 2G
ports:
- "8080:8080"
networks:
shellbot-net:
ipv4_address: 172.18.0.101
hostname: shellbot3000
extra_hosts:
- "shellbot-mariadb:172.18.0.102"
environment:
NODE_ENV: "development"
WAIT_HOSTS: shellbot-mariadb:3306
DOCKER_ENV: "${DOCKER_ENV}"
volumes:
- .:/usr/src/app
- /usr/src/app/node_modules
command: sh -c "/wait && npm install && if test "$DOCKER_ENV" = 'testing'; then npm run migrate:test; else npm run migrate && mysql -h shellbot-mariadb -u root < initdev.sql; fi && if test "$DOCKER_ENV" = 'testing'; then echo '' && echo '>>>>>>>>> GOING TO SLEEP NOW, READY FOR MANUAL CLI TESTS <<<<<<<<<<<' && sleep infinity; else npm run dev:watch; fi"