-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
82 lines (75 loc) · 1.84 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
version: '3'
services:
api-gateway:
build: './api-gateway'
depends_on:
- todos-service
- users-service
environment:
- TODOS_SERVICE_URI=http://todos-service:4001
- USERS_SERVICE_URI=http://users-service:4002
ports:
- '4000:4000'
volumes:
- ./api-gateway:/opt/app
todos-service:
build: './todos-service'
depends_on:
- todos-service-db
environment:
- MONGO_USERNAME=admin
- MONGO_PASSWORD=secret
- MONGO_DATABASE=todos
- MONGO_HOST=todos-service-db
- MONGO_PORT=27017
ports:
- '4001:4001'
volumes:
- ./todos-service:/opt/app
todos-service-db:
image: mongo
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: secret
MONGO_INITDB_DATABASE: todos
MONGO_USERNAME: admin
MONGO_PASSWORD: secret
volumes:
- todosdata:/data/db
- ./mongo-init-todos.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
ports:
- '6000:27017'
users-service:
build: './users-service'
depends_on:
- users-service-db
environment:
- MONGO_USERNAME=admin
- MONGO_PASSWORD=secret
- MONGO_DATABASE=auth
- MONGO_HOST=users-service-db
- MONGO_PORT=27017
ports:
- '4002:4002'
volumes:
- ./users-service:/opt/app
users-service-db:
image: mongo
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: secret
MONGO_INITDB_DATABASE: auth
MONGO_USERNAME: admin
MONGO_PASSWORD: secret
volumes:
- usersdata:/data/db
- ./mongo-init-users.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
ports:
- '7000:27017'
volumes:
todosdata:
external: true
usersdata:
external: true
# docker volume create --name=todosdata
# docker volume create --name=usersdata