-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
52 lines (50 loc) · 1.24 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
version: "3.7"
services:
users:
build:
context: ./users
dockerfile: Dockerfile.prod
volumes:
- "./users:/usr/src/app"
ports:
- 5001:5000
environment:
# Because it's in a different container we must use the container's IP
# MYSQL_DATABASE: users_prod
MYSQL_ROOT_PASSWORD: password
MYSQL_USER: root
MYSQL_PASSWORD: password
DATABASE_HOST: users-db #change this to users-db because it links to the other db container
depends_on:
- users-db
restart: on-failure:5
users-db:
build:
context: ./users/database
dockerfile: Dockerfile
environment:
# MYSQL_DATABASE: users_prod
MYSQL_ROOT_PASSWORD: password
# MYSQL_USER: root
# MYSQL_PASSWORD: password
DATABASE_HOST: users-db #change this to users-db
ports:
- "3307:3306"
# volumes:
# - users-db:/var/lib/mysql
client:
build:
context: ./client
dockerfile: Dockerfile.prod
volumes:
- "./client:/usr/src/app"
- "/usr/src/app/node_modules"
ports:
- 3007:3000
environment:
- NODE_ENV=development
- REACT_APP_USERS_SERVICE_URL=${REACT_APP_USERS_SERVICE_URL}
depends_on:
- users
volumes:
users-db: