-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
139 lines (139 loc) · 3.33 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
version: '3.8'
services:
auth-db:
container_name: auth-db
image: postgres:11-alpine3.15
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: auth-db
ports:
- '35432:5432'
restart: always
volumes:
- .docker/auth-db:/var/lib/postgresql/data
networks:
- microservice-network
product-db:
container_name: product-db
image: postgres:11-alpine3.15
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: product-db
ports:
- '35433:5432'
restart: always
volumes:
- .docker/product-db:/var/lib/postgresql/data
networks:
- microservice-network
sales-db:
image: mongo:latest
container_name: sales-db
environment:
- MONGO_INITDB_ROOT_USERNAME=root
- MONGO_INITDB_ROOT_PASSWORD=root
volumes:
- .docker/sales-db:/data/db
ports:
- '27017:27017'
networks:
- microservice-network
restart: always
mongo-express:
image: mongo-express
container_name: mongo-express
environment:
- ME_CONFIG_MONGODB_SERVER=sales-db
- ME_CONFIG_MONGODB_ENABLE_ADMIN=true
- ME_CONFIG_MONGODB_ADMINUSERNAME=root
- ME_CONFIG_MONGODB_ADMINPASSWORD=root
- ME_CONFIG_BASICAUTH_USERNAME=user
- ME_CONFIG_BASICAUTH_PASSWORD=user
links:
- sales-db
volumes:
- .docker/mongo-express:/data/db
depends_on:
- sales-db
networks:
- microservice-network
ports:
- '38081:8081'
restart: always
queue:
image: rabbitmq:3-management
container_name: queue
hostname: queue
ports:
- '5672:5672'
- '25676:25676'
- '15672:15672'
environment:
RABBITMQ_DEFAULT_USER: root
RABBITMQ_DEFAULT_PASS: root
networks:
- microservice-network
auth-api:
build: './auth-api'
container_name: auth-api
environment:
- PORT=8082
- POSTGRES_PORT=5432
- POSTGRES_BASE_URL=auth-db
- API_SECRET=YXV0aC1hcGkgc2VjcmV0IGRldiAxMjM0NTY=
ports:
- '8082:8082'
depends_on:
- auth-db
networks:
- microservice-network
sales-api:
build: './sales-api'
container_name: sales-api
depends_on:
- sales-db
- queue
environment:
- PORT=8081
- API_SECRET=YXV0aC1hcGkgc2VjcmV0IGRldiAxMjM0NTY=
- RABBITMQ_USER=root
- RABBITMQ_PASS=root
- RABBITMQ_HOST=queue
- RABBITMQ_PORT=5672
- MONGODB_URL=mongodb://root:root@sales-db:27017/sales-db?authSource=admin
- PRODUCT_HOST=product-api
- PRODUCT_PORT=8080
ports:
- '8081:8081'
networks:
- microservice-network
product-api:
build: './product-api'
container_name: product-api
depends_on:
- product-db
- queue
environment:
- PORT=8080
- API_SECRET=YXV0aC1hcGkgc2VjcmV0IGRldiAxMjM0NTY=
- RABBITMQ_USER=root
- RABBITMQ_PASS=root
- RABBITMQ_HOST=queue
- RABBITMQ_PORT=5672
- SALES_HOST=sales-api
- SALES_PORT=8081
- POSTGRES_HOST=product-db
- POSTGRES_USER=postgres
- POSTGRES_PASS=postgres
- POSTGRES_PORT=5432
- POSTGRES_DROP=update
ports:
- '8080:8080'
networks:
- microservice-network
networks:
microservice-network:
driver: bridge
name: microservice-network