-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
88 lines (84 loc) · 2.02 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
78
79
80
81
82
83
84
85
86
87
88
version: "2.1"
services:
# production container
app_parking_lot_api:
build:
context: .
dockerfile: Dockerfile
image: parking-lot-api:1.0.0
container_name: ctn_parking_lot_api
restart: always
working_dir: /usr/src/app
command: >
sh -c "npx sequelize db:create &&
npx sequelize db:migrate &&
node server.js"
ports:
- 5005:5005
links:
- db_mysql
environment:
- PORT=5005
- DEBUG=parking-lot-api:*
- SECRET=meow
- DB_HOST=db_mysql
- DB_NAME=parking_lot_api
- DB_USERNAME=root
- DB_PASSWORD=rootpass
- DB_PORT=3306
depends_on:
db_mysql:
condition: service_healthy
# alpha / develop container for testing purpose
app_parking_lot_api_alpha:
build:
context: .
dockerfile: Dockerfile.alpha
image: parking-lot-api:1.0.0-alpha
container_name: ctn_parking_lot_api_alpha
restart: always
working_dir: /usr/src/app
command: >
sh -c "npx sequelize db:create &&
npx sequelize db:migrate &&
node server.js"
ports:
- 5006:5005
links:
- db_mysql
environment:
- PORT=5005
- DEBUG=parking-lot-api:*
- SECRET=meow
- DB_HOST=db_mysql
- DB_NAME=parking_lot_api_alpha
- DB_USERNAME=root
- DB_PASSWORD=rootpass
- DB_PORT=3306
depends_on:
db_mysql:
condition: service_healthy
# example of client
app_parking_lot_client:
build:
context: ./example
dockerfile: Dockerfile
image: parking-lot-client:1.0.0
container_name: ctn_parking_lot_client
restart: always
working_dir: /usr/src/app
ports:
- 5007:5007
db_mysql:
image: mysql:8.0.19
container_name: ctn_mysql
ports:
- 3306:3306
environment:
- MYSQL_ROOT_PASSWORD=rootpass
- MYSQL_USER=joe
- MYSQL_PASSWORD=joepass
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 20s
retries: 10