-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
53 lines (49 loc) · 1.24 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
version: '3.6'
services:
smart-farm-api:
# uncomment the below volume to mount the cur dir to app in container, so nodemon will work
volumes:
- ./:/usr/src/app
build: .
image: smart-farm-api
container_name:
smart-farm-api
restart: always
command: "npm run dev"
ports:
- "8000:8000"
networks:
- smart-farm-network
links:
- db_mongo_smart-farm
depends_on:
- db_mongo_smart-farm
environment:
MONGO_HOST: db_mongo_smart-farm
MONGO_DATABASE: ${MONGO_DATABASE}
MONGO_USER: ${MONGO_USER}
MONGO_PASSWORD: ${MONGO_PASSWORD}
MONGO_PORT: 27017
SECRET_KEY: ${SECRET_KEY}
db_mongo_smart-farm:
image: mongo:latest
container_name: db_mongo_smart-farm
restart: always
environment:
- MONGO_DATA_DIR=/data/db
- MONGO_INITDB_DATABASE=${MONGO_DATABASE}
- MONGO_INITDB_ROOT_USERNAME=${ROOT_USERNAME}
- MONGO_INITDB_ROOT_PASSWORD=${ROOT_PASSWORD}
volumes:
- db_mongo_smart-farm-data:/data/db
- ./db-init/:/docker-entrypoint-initdb.d/
ports:
- 27017:27017
networks:
- smart-farm-network
volumes:
db_mongo_smart-farm-data:
networks:
smart-farm-network:
driver:
bridge