-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
188 lines (178 loc) · 4.32 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# version: '3.1'
services:
user:
container_name: 'user_api'
build:
context: .
dockerfile: ./apps/user/Dockerfile
target: development
command: npm run start:dev user
depends_on:
mysql_user:
condition: service_healthy
env_file:
- ./apps/user/.env
ports:
- '3001:3000'
volumes:
- .:/usr/src/app
- /usr/src/app/node_modules
mysql_user:
image: mysql:9.0
container_name: 'mysql_user_db'
environment:
MYSQL_ROOT_PASSWORD: 1234
TZ: Asia/Seoul
ports:
- '6001:3306'
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
volumes:
- ./mysql/user:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
interval: 5s
timeout: 5s
retries: 10
start_period: 5s
product:
container_name: 'product_api'
build:
context: .
dockerfile: ./apps/product/Dockerfile
target: development
command: npm run start:dev product
depends_on:
mysql_product:
condition: service_healthy
env_file:
- ./apps/product/.env
ports:
- '3002:3000'
volumes:
- .:/usr/src/app
- /usr/src/app/node_modules
mysql_product:
image: mysql:9.0
container_name: 'mysql_product_db'
environment:
MYSQL_ROOT_PASSWORD: 1234
TZ: Asia/Seoul
ports:
- '6002:3306'
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
volumes:
- ./mysql/product:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
interval: 5s
timeout: 5s
retries: 10
start_period: 5s
order:
container_name: 'order_api'
build:
context: .
dockerfile: ./apps/order/Dockerfile
target: development
command: npm run start:dev order
depends_on:
mongo_order:
condition: service_healthy
env_file:
- ./apps/order/.env
ports:
- '3003:3000'
volumes:
- .:/usr/src/app
- /usr/src/app/node_modules
mongo_order:
image: mongo:8
container_name: 'mongo_order_db'
environment:
MONGO_INITDB_ROOT_USERNAME: mongo
MONGO_INITDB_ROOT_PASSWORD: 1234
ports:
- '6003:27017'
volumes:
- ./mongo/order:/data/lib
command: mongod --quiet --logpath /dev/null
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 5s
timeout: 5s
retries: 10
start_period: 5s
payment:
container_name: 'payment_api'
build:
context: .
dockerfile: ./apps/payment/Dockerfile
target: development
command: npm run start:dev payment
depends_on:
mysql_payment:
condition: service_healthy
env_file:
- ./apps/payment/.env
ports:
- '3004:3000'
volumes:
- .:/usr/src/app
- /usr/src/app/node_modules
mysql_payment:
image: mysql:9.0
container_name: 'mysql_payment_db'
environment:
MYSQL_ROOT_PASSWORD: 1234
TZ: Asia/Seoul
ports:
- '6004:3306'
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
volumes:
- ./mysql/payment:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
interval: 5s
timeout: 5s
retries: 10
start_period: 5s
notification:
container_name: 'notification_api'
build:
context: .
dockerfile: ./apps/notification/Dockerfile
target: development
command: npm run start:dev notification
depends_on:
mongo_notification:
condition: service_healthy
env_file:
- ./apps/notification/.env
ports:
- '3005:3000'
volumes:
- .:/usr/src/app
- /usr/src/app/node_modules
mongo_notification:
image: mongo:8
container_name: 'mongo_notification_db'
environment:
MONGO_INITDB_ROOT_USERNAME: mongo
MONGO_INITDB_ROOT_PASSWORD: 1234
ports:
- '6005:27017'
volumes:
- ./mongo/notification:/data/lib
command: mongod --quiet --logpath /dev/null
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 5s
timeout: 5s
retries: 10
start_period: 5s