-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
32 lines (28 loc) · 937 Bytes
/
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
#Shared Config
version: "3.8"
services:
nginx: #NGINX image
image: nginx:stable-alpine
ports:
- "3000:80" #server_port:NGINX_port
volumes:
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf:ro #mapping nginx default.conf file of source code into nginx container (bind mount syncing)
express-server: #server image
build: .
image: insanelytamojit/devops_docker #image pushed to dockerhub
environment:
- PORT=3000
depends_on:
- mongo #spins up mongo container first, so that the express server container can connect to active db & not crash
mongo: #DB image
image: mongo:latest
environment:
- MONGO_INITDB_ROOT_USERNAME=Tamoziit
- MONGO_INITDB_ROOT_PASSWORD=tamojitdas2605
volumes:
- mongo-db:/data/db #name:path --> to persist data in a named vol.
redis: #redis image
image: redis:latest
#named volumes declarations
volumes:
mongo-db: