-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-local.yml
50 lines (46 loc) · 1.13 KB
/
docker-compose-local.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
version: "3.4"
services:
rest-api-movies:
container_name: rest-api-movies
restart: always
build: .
ports:
- ${APP_PORT}:3001
links:
- mongodb
depends_on:
- mongodb
networks:
- app-network
environment:
- WAIT_HOSTS=db:${DB_PORT}
- API_KEY=${API_KEY}
- DB_USER_NAME=${DB_USER_NAME}
- DB_USER_PASSWORD=${DB_USER_PASSWORD}
- DB_PORT=${DB_PORT}
- MONGO_INITDB_DATABASE=${MONGO_INITDB_DATABASE}
- DB_HOST=${DB_HOST}
volumes:
- ./:/usr/src/app
mongodb:
image: mongo:4.4.0
container_name: ${DB_HOST}
restart: always
ports:
- ${DB_PORT}:27017
environment:
- MONGO_INITDB_DATABASE=${MONGO_INITDB_DATABASE}
- MONGO_INITDB_ROOT_USERNAME=${MONGO_INITDB_ROOT_USERNAME}
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_INITDB_ROOT_PASSWORD}
- DB_USER_NAME=${DB_USER_NAME}
- DB_USER_PASSWORD=${DB_USER_PASSWORD}
volumes:
- mongodata:/data/db
- ./mongo-init.sh:/docker-entrypoint-initdb.d/mongo-init.sh
networks:
- app-network
networks:
app-network:
driver: bridge
volumes:
mongodata: