-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
53 lines (51 loc) · 1.19 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
version: "3.4"
x-common-variables: &common-variables
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
REACT_APP_MAPBOX_TOKEN: ${REACT_APP_MAPBOX_TOKEN}
REACT_APP_SERVER_PORT: ${REACT_APP_SERVER_PORT}
services:
mysql:
image: mysql:5.7
environment:
<<: *common-variables
MYSQL_HOST: ${MYSQL_HOST}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
ports:
- ${MYSQL_PORT}:3306
restart: unless-stopped
volumes:
- ./db/ddl.sql:/docker-entrypoint-initdb.d/ddl.sql
- mysql-data-volume:/var/lib/mysql
client:
build: ./client
environment:
<<: *common-variables
NODE_PATH: src
expose:
- 3000
ports:
- ${CLIENT_PORT}:3000
volumes:
- ./client/src:/app/src
stdin_open: true
command: npm start
server:
build: ./server
depends_on:
- mysql
expose:
- ${REACT_APP_SERVER_PORT}
environment:
<<: *common-variables
MYSQL_HOST_IP: mysql
ports:
- ${REACT_APP_SERVER_PORT}:${REACT_APP_SERVER_PORT}
volumes:
- ./server:/app
links:
- mysql
command: ["./run_server.sh"]
volumes:
mysql-data-volume: