-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
191 lines (177 loc) · 4.47 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
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
version: '3.8'
services:
redis-server:
container_name: redis-server
image: 'redis/redis-stack-server'
volumes:
- redis-data:/data
ports: # enable to visualize data in redis insight
- '${REDIS_INSIGHT_PORT}:6379'
mongodb-server: # mongodb with replica for transactions support
container_name: mongodb-server
build:
context: ./
dockerfile: dockerfile-mongodb-replica
volumes:
- mongodb-data:/data/db # default path
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: prisma
MONGO_REPLICA_HOST: mongodb-server
MONGO_REPLICA_PORT: 27017
ports: # enable to visualize data in mongodb compass
- '${MONGODB_COMPASS_PORT}:27017'
# mongodb compass url is mongodb://localhost:27017/?directConnection=true
postgresql-server:
container_name: postgresql-server
image: postgres:latest
restart: unless-stopped
environment:
- POSTGRES_DB=tests
- POSTGRES_USER=prisma
- POSTGRES_PASSWORD=prisma
ports:
- '${POSTGRES_PORT}:5432'
postgresql-pg-admin-gui:
container_name: postgresql-pg-admin-gui
image: dpage/pgadmin4
environment:
- PGADMIN_DEFAULT_PASSWORD=password
ports:
- '${POSTGRES_PG_ADMIN_PORT}:80'
cdn:
container_name: cdn
build:
context: ./
dockerfile: dockerfile-cdn
args:
BUILD_BASE_PATH: cdn
ports:
- '${CDN_PORT}:80'
database-seed:
container_name: database-seed
build:
context: ./
dockerfile: dockerfile-database-seed
args:
BUILD_BASE_PATH: database
env_file:
- ./.env
depends_on:
- mongodb-server
- postgresql-server
- cdn # to seed products image summary
orders-service:
container_name: orders-service
build:
context: ./
dockerfile: dockerfile-server
args:
BUILD_BASE_PATH: server/src/services/orders
env_file:
- ./.env
depends_on:
- redis-server
- mongodb-server
order-history-service:
container_name: order-history-service
build:
context: ./
dockerfile: dockerfile-server
args:
BUILD_BASE_PATH: server/src/services/order-history
env_file:
- ./.env
depends_on:
- redis-server
- mongodb-server
products-service:
container_name: products-service
build:
context: ./
dockerfile: dockerfile-server
args:
BUILD_BASE_PATH: server/src/services/products
env_file:
- ./.env
depends_on:
- redis-server
- mongodb-server
payments-service:
container_name: payments-service
build:
context: ./
dockerfile: dockerfile-server
args:
BUILD_BASE_PATH: server/src/services/payments
env_file:
- ./.env
depends_on:
- redis-server
- mongodb-server
- orders-service
digital-identity-service:
container_name: digital-identity-service
build:
context: ./
dockerfile: dockerfile-server
args:
BUILD_BASE_PATH: server/src/services/digital-identity
env_file:
- ./.env
depends_on:
- redis-server
- mongodb-server
- payments-service
profile-service:
container_name: profile-service
build:
context: ./
dockerfile: dockerfile-server
args:
BUILD_BASE_PATH: server/src/services/profile
env_file:
- ./.env
depends_on:
- redis-server
- mongodb-server
- payments-service
api-gateway:
container_name: api-gateway
build:
context: ./
dockerfile: dockerfile-server
args:
BUILD_BASE_PATH: server/src/api-gateway
ports:
- '${API_GATEWAY_PORT}:${API_GATEWAY_PORT}'
env_file:
- ./.env
depends_on:
- orders-service
- order-history-service
- products-service
- digital-identity-service
client:
container_name: client
build:
context: ./
dockerfile: dockerfile-client
args:
BUILD_BASE_PATH: client/nextjs
API_GATEWAY_URI: ${API_GATEWAY_URI}
NEXT_PUBLIC_API_GATEWAY_URI: ${NEXT_PUBLIC_API_GATEWAY_URI}
NEXT_PUBLIC_LANDING_PAGE_CODE: ${NEXT_PUBLIC_LANDING_PAGE_CODE}
ports:
- '${FRONTEND_CLIENT_PORT}:${FRONTEND_CLIENT_PORT}'
env_file:
- ./.env
stdin_open: true # -i input flag
tty: true # -t terminal flag
depends_on:
- api-gateway
- cdn
volumes:
redis-data:
mongodb-data: