-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
83 lines (78 loc) · 2.17 KB
/
docker-compose.yaml
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
services:
auth:
container_name: tour-auth
# TODO: build 사용 시 npm ci 오류가 발생해서 일단 이미지를 따로 빌드(docker image build)하고 사용한다. build로 수정이 필요하다.
image: csup96/tour-auth
command: npm run start:dev
env_file:
- ./auth/.env
ports:
- '3000:3000'
volumes:
# .:/opt/express_app/app은 server.ts 파일을 찾을 수 없다는 오류가 발생한다.
- ./auth:/opt/express_app/app
depends_on:
mongo:
condition: service_healthy
healthcheck:
disable: true
review:
container_name: tour-review
image: csup96/tour-review
command: npm run start:dev
env_file:
- ./review/.env
ports:
- '3001:3001'
volumes:
- ./review:/opt/express_app/app
depends_on:
mongo:
condition: service_healthy
healthcheck:
disable: true
tour:
container_name: tour-tour
image: csup96/tour-tour
command: npm run start:dev
env_file:
- ./tour/.env
ports:
- '3002:3002'
volumes:
- ./tour:/opt/express_app/app
depends_on:
mongo:
condition: service_healthy
healthcheck:
disable: true
mongo:
container_name: tour-mongo
image: mongo:7.0.9
ports:
- '27017:27017'
environment:
# 다음 환경변수는 관리자(admin) 데이터베이스에 사용자를 생성한다.
# 연결 문자열을 사용할 때 retryWrites=true&writeConcern=majority&authSource=admin을 추가해야 한다.
- MONGO_INITDB_ROOT_USERNAME=root
- MONGO_INITDB_ROOT_PASSWORD=root
volumes:
- mongodb:/data/db
healthcheck:
test: '[ `echo ''db.runCommand("ping").ok'' | mongo localhost:27017/test --quiet` ] && echo 0 || echo 1'
interval: 5s
timeout: 4s
retries: 5
start_period: 5m
mongo-express:
container_name: tour-mongo-express
image: mongo-express
ports:
- '8081:8081'
environment:
- ME_CONFIG_MONGODB_ADMINUSERNAME=root
- ME_CONFIG_MONGODB_ADMINPASSWORD=root
- ME_CONFIG_MONGODB_URL=mongodb://root:root@mongo:27017/
- ME_CONFIG_BASICAUTH=false
volumes:
mongodb: