-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
54 lines (52 loc) · 1.21 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
version: '2'
services:
server:
build:
context: ./server/
# command: /usr/app/node_modules/.bin/nodemon server.js
command: sh -c 'chmod +x /usr/app/wait-for-it.sh && /usr/app/wait-for-it.sh mysql:3306 -- /usr/app/node_modules/.bin/nodemon server.js'
volumes:
- ./server/:/usr/app
- /usr/app/node_modules
ports:
- "8484:8484"
depends_on:
- mysql
# env_file: ./server/.env # TODO - uncomment this to auto-load your .env file!
environment:
- NODE_ENV=development
- CHOKIDAR_USEPOLLING=true
networks:
- mern-app
client:
build:
context: ./client/
command: sh -c 'echo "PORT=3030" > .env && npm start'
volumes:
- ./client/:/usr/app
- /usr/app/node_modules
depends_on:
- server
ports:
- "3030:3030"
networks:
- mern-app
mysql:
image: mysql:5.7
networks:
- mern-app
environment:
- MYSQL_DATABASE=routes
- MYSQL_ROOT_PASSWORD=password_gtres
- MYSQL_USER=rootu
- MYSQL_PASSWORD=password
volumes:
- mysql_data:/var/lib/mysql
ports:
- "3306:3306"
restart: always
networks:
mern-app:
driver: bridge
volumes:
mysql_data: