-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.prod.yml
203 lines (200 loc) · 4.23 KB
/
docker-compose.prod.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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# NOTE: The ports of internal services (eg. book, customer, payment, borrowing) are not exposed in production
services:
# app services
book:
build:
context: .
dockerfile: ./apps/Dockerfile.service
target: production
args:
service: book
env_file:
- ./apps/book/.env
environment:
- MONGODB_URI=mongodb://mongodb:27017/libraryapp-book
- RABBIT_MQ_URI=amqp://rabbitmq:5672
- BASEURL_AUTH=http://auth:8005
depends_on:
- mongodb
- rabbitmq
# ports:
# - '8001:8001'
networks:
- node-network
links:
- mongodb
- rabbitmq
customer:
build:
context: .
dockerfile: ./apps/Dockerfile.service
target: production
args:
service: customer
env_file:
- ./apps/customer/.env
environment:
- MONGODB_URI=mongodb://mongodb:27017/libraryapp-customer
- BASEURL_AUTH=http://auth:8005
depends_on:
- mongodb
# ports:
# - '8002:8002'
networks:
- node-network
links:
- mongodb
borrowing:
build:
context: .
dockerfile: ./apps/Dockerfile.service
target: production
args:
service: borrowing
env_file:
- ./apps/borrowing/.env
environment:
- MONGODB_URI=mongodb://mongodb:27017/libraryapp-borrowing
- RABBIT_MQ_URI=amqp://rabbitmq:5672
- BASEURL_AUTH=http://auth:8005
depends_on:
- mongodb
- rabbitmq
# ports:
# - '8003:8003'
networks:
- node-network
links:
- mongodb
- rabbitmq
payment:
build:
context: .
dockerfile: ./apps/Dockerfile.service
target: production
args:
service: payment
env_file:
- ./apps/payment/.env
environment:
- MONGODB_URI=mongodb://mongodb:27017/libraryapp-payment
- RABBIT_MQ_URI=amqp://rabbitmq:5672
- BASEURL_AUTH=http://auth:8005
depends_on:
- mongodb
- rabbitmq
# ports:
# - '8004:8004'
networks:
- node-network
links:
- mongodb
- rabbitmq
auth:
build:
context: .
dockerfile: ./apps/Dockerfile.service
target: production
args:
service: auth
env_file:
- ./apps/auth/.env
depends_on:
- mongodb
# ports:
# - '8005:8005'
networks:
- node-network
links:
- book
- customer
- borrowing
- payment
environment:
- BASEURL_CUSTOMER=http://customer:8002
notification:
build:
context: .
dockerfile: ./apps/Dockerfile.service
target: production
args:
service: notification
env_file:
- ./apps/notification/.env
environment:
- RABBIT_MQ_URI=amqp://rabbitmq:5672
depends_on:
- rabbitmq
# ports:
# - '8005:8005'
networks:
- node-network
links:
- rabbitmq
view:
build:
context: .
dockerfile: ./apps/Dockerfile.view
args:
service: view
env_file:
- ./apps/view/.env
depends_on:
- book
- customer
- borrowing
- payment
- auth
- notification
ports:
- '8000:8000'
networks:
- node-network
apigateway:
build:
context: .
dockerfile: ./apps/Dockerfile.apigateway
target: production
args:
service: apigateway
env_file:
- ./apps/apigateway/.env
ports:
- '8080:8080'
networks:
- node-network
links:
- book
- customer
- borrowing
- payment
- auth
environment:
- BASEURL_BOOK=http://book:8001
- BASEURL_CUSTOMER=http://customer:8002
- BASEURL_BORROWING=http://borrowing:8003
- BASEURL_PAYMENT=http://payment:8004
- BASEURL_AUTH=http://auth:8005
# Dependencies
rabbitmq:
image: rabbitmq
ports:
- '5672:5672'
networks:
- node-network
mongodb:
image: mongo:6
volumes:
- mongodb_data_container:/data/db
ports:
- '27017:27017'
networks:
- node-network
volumes:
mongodb_data_container:
networks:
node-network:
driver: bridge
# docker compose -f docker-compose.prod.yml up -d
# docker compose -f docker-compose.prod.yml up -d --build
# docker compose -f docker-compose.prod.yml down