-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
173 lines (160 loc) · 3.66 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
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
version: '3.8'
services:
# api gateway container
api-gateway:
build:
context: ./api-gateway
dockerfile: Dockerfile
image: nikhil382/ecommerce-microservice-clean-arch-api-gateway
ports:
- ${PORT}${PORT}
env_file:
- .env
networks:
- ecommerce-micro
restart: always
# auth db container
auth-db:
image: postgres
environment:
- POSTGRES_USER=${AUTH_DB_USER}
- POSTGRES_PASSWORD=${AUTH_DB_PASSWORD}
- POSTGRES_DB=${AUTH_DB_NAME}
networks:
- ecommerce-micro
volumes:
- auth-database:/var/lib/postgresql/data
restart: always
# auth service container
auth-service:
build:
context: ./auth-service
dockerfile: Dockerfile
image: nikhil382/ecommerce-microservice-clean-arch-auth-service
env_file:
- .env
environment:
- AUTH_DB_HOST=auth-db
networks:
- ecommerce-micro
restart: always
depends_on:
- auth-db
# user database
user-db:
image: postgres
environment:
- POSTGRES_USER=${USER_DB_USER}
- POSTGRES_PASSWORD=${USER_DB_PASSWORD}
- POSTGRES_DB=${USER_DB_NAME}
networks:
- ecommerce-micro
volumes:
- user-database:/var/lib/postgresql/data
restart: always
# user service container
user-service:
build:
context: ./user-service
dockerfile: Dockerfile
image: nikhil382/ecommerce-microservice-clean-arch-user-service
env_file:
- .env
environment:
- USER_DB_HOST=user-db
networks:
- ecommerce-micro
restart: always
depends_on:
- user-db
# product database
product-db:
image: postgres
environment:
- POSTGRES_USER=${PRODUCT_DB_USER}
- POSTGRES_PASSWORD=${PRODUCT_DB_PASSWORD}
- POSTGRES_DB=${PRODUCT_DB_NAME}
volumes:
- product-database:/var/lib/postgresql/data
networks:
- ecommerce-micro
restart: always
# product service
product-service:
build:
context: ./product-service
dockerfile: Dockerfile
image: nikhil382/ecommerce-microservice-clean-arch-product-service
env_file:
- .env
environment:
- PRODUCT_DB_HOST=product-db
restart: always
networks:
- ecommerce-micro
depends_on:
- product-db
# cart database
cart-db:
image: postgres
environment:
- POSTGRES_USER=${CART_DB_USER}
- POSTGRES_PASSWORD=${CART_DB_PASSWORD}
- POSTGRES_DB=${CART_DB_NAME}
volumes:
- cart-database:/var/lib/postgresql/data
networks:
- ecommerce-micro
restart: always
# cart service
cart-service:
build:
context: ./cart-service
dockerfile: Dockerfile
image: nikhil382/ecommerce-microservice-clean-arch-cart-service
env_file:
- .env
depends_on:
- cart-db
networks:
- ecommerce-micro
restart: always
# order database
order-db:
image: postgres
environment:
- POSTGRES_USER=${ORDER_DB_USER}
- POSTGRES_PASSWORD=${ORDER_DB_PASSWORD}
- POSTGRES_DB=${ORDER_DB_NAME}
volumes:
- order-databse:/var/lib/postgresql/data
networks:
- ecommerce-micro
restart: always
# order service
order-service:
build:
context: ./order-service
dockerfile: Dockerfile
image: nikhil382/ecommerce-microservice-clean-arch-order-service
env_file:
- .env
depends_on:
- order-db
networks:
- ecommerce-micro
restart: always
volumes:
auth-database:
driver: local
user-database:
driver: local
product-database:
driver: local
cart-database:
driver: local
order-databse:
driver: local
networks:
ecommerce-micro:
driver: bridge