-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yaml
260 lines (184 loc) · 5.34 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
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
version: "3.3"
# Docker containers in the network
services:
# Container to run frontend
admin_client_container:
# Passing build context
build:
context: ./src/admin_client
dockerfile: Dockerfile
# Syncing with dockerhub stored image
image: mohitdmak/bits_vaccination_portal:admin_client
# Supply env configs
env_file:
- src/config/APP.env
# hot reloads
environment:
CHOKIDAR_USEPOLLING: "true"
# setting container name
container_name: AdminClientContainer
# Critical container
restart: always
# Set volumes
volumes:
- ./src/admin_client:/app
- '/app/node_modules'
# Set ports config
ports:
- 1400:3000
# Container to run frontend
client_container:
# Passing build context
build:
context: ./src/client
dockerfile: Dockerfile
# Syncing with dockerhub stored image
image: mohitdmak/bits_vaccination_portal:client
# Supply env configs
env_file:
- src/config/APP.env
# hot reloads
environment:
CHOKIDAR_USEPOLLING: "true"
# setting container name
container_name: ClientContainer
# Critical container
restart: always
# Set volumes
volumes:
- ./src/client:/app
- '/app/node_modules'
# Set ports config
ports:
- 80
# Container to run mongo db in same docker network
mongo_container:
# Passing build context
build:
context: .
dockerfile: dockerfiles/Mongo.dockerfile
# Syncing with dockerhub stored image
image: mohitdmak/bits_vaccination_portal:mongo
# Setting Container name to be called from express app
container_name: MongoContainer
# Mongo DB Config
# env_file:
# - config/mongo.env
# DB needs to always be up
restart: always
# Setting external volume for /data/db in mongo container
volumes:
- type: volume
source: mongodb_data_volume
target: /data/db
# Not binding mongo
ports:
- 27017
# Container to provide admin interface to running mongo container
db-admin_container:
# Provide build context
build:
context: .
dockerfile: dockerfiles/DbAdmin.dockerfile
# Push to registry hosting containers
image: mohitdmak/bits_vaccination_portal:db_admin
# Name for nginx to access
container_name: DbAdminContainer
# Supply env configs
env_file:
- src/config/DB_ADMIN_CONFIG.env
# Dont start admin panel before db is running
# depends_on:
# - dev_container
# Critical container service
restart: always
# Dont expose port to local machine, keep secure https connection
ports:
- 8081
# # Container to provide interface to running mongo container
# mongo-express_container:
# # default image
# image: mongo-express
# # Default name
# container_name: MongoExpressContainer
# # environment configs
# env_file:
# - config/mongo-express2.env
# # Main mongo server needs to start first
# depends_on:
# - dev_container
# # Restart always, since Mongo container needs time to be up
# restart: always
# # Linking host os here
# ports:
# - 8080:8081
# Container to run development environment
dev_container:
# Passing build context
build:
context: .
dockerfile: dockerfiles/Api.dockerfile
# Syncing with dockerhub stored image
image: mohitdmak/bits_vaccination_portal:dev_web
# Supply env configs
env_file:
- src/config/APP.env
container_name: DevContainer
# Restart in-case of Test Container failure
restart: always
# Creating volume bind between source code and working dir
volumes:
- .:/Portal
- /Portal/node_modules/
# Binding port 3000 with host os.
ports:
- 3000
# Ensuring Db Container has been started before main app are ready
depends_on:
- mongo_container
# Container to proxy requests on port 80 of AWS to web api running in port 3000 in container
nginx_container:
# Build context
build:
context: .
dockerfile: dockerfiles/Nginx.dockerfile
# Sync with dockerhub stored image
image: mohitdmak/bits_vaccination_portal:nginx
# Setting up context
container_name: NginxContainer
# Proxy to listen always
restart: always
# Binding port 80 with host port 1340
ports:
- 1370:443
# Using nginx config defined in folder
volumes:
- ./nginx/nginx.conf:/etc/nginx/conf.d/nginx.conf
# Wait for web_api container to start first
depends_on:
- db-admin_container
# Container to proxy requests on port 80 of AWS to web api running in port 3000 in container
redis_container:
# Build context
build:
context: .
dockerfile: dockerfiles/Redis.dockerfile
# Sync with dockerhub stored image
image: mohitdmak/bits_vaccination_portal:redis_sessions
# Setting up context
container_name: RedisSessionContainer
# Proxy to listen always
restart: always
# Binding port 80 with host os port 1340
ports:
- 7000
# Using nginx config defined in folder
volumes:
- ./redis:/data
# Ensuring Dev Container has been started before redis sessions are ready
# depends_on:
# - dev_container
# NAMED VOLUMES
volumes:
mongodb_data_volume:
external: true