-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
43 lines (39 loc) · 843 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
33
34
35
36
37
38
39
40
41
42
43
version: '3.7'
services:
api-service:
hostname: api-service
container_name: api-service
build: ./
ports:
- 3001:3001
restart: unless-stopped
depends_on:
- db-service
environment:
- DB_HOST=db-service
- DB_USER=$MONGODB_USER
- DB_PASSWORD=$MONGODB_PASSWORD
- DB_NAME=$MONGODB_DATABASE
- DB_PORT=$MONGODB_DOCKER_PORT
- NODE_ENV=$NODE_ENV
- APP_PORT=$APP_PORT
networks:
- backend
db-service:
hostname: db-service
container_name: db-service
image: mongo
environment:
- MONGO_INITDB_ROOT_USERNAME=$MONGODB_USER
- MONGO_INITDB_ROOT_PASSWORD=$MONGODB_PASSWORD
ports:
- 27017:27017
volumes:
- dbdata:/data/db
networks:
- backend
networks:
backend:
driver: bridge
volumes:
dbdata: