-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
56 lines (49 loc) · 1.05 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
version: '3'
services:
nodejs:
build:
context: .
dockerfile: Dockerfile
image: nodejs
container_name: nodejs
restart: always
env_file: .env
environment:
- NODE_ENV=$NODE_ENV
- PORT=$PORT
- MONGO_USERNAME=$MONGO_USERNAME
- MONGO_PASSWORD=$MONGO_PASSWORD
- MONGO_HOST=$MONGO_HOST
- MONGO_PORT=$MONGO_PORT
- MONGO_DATABASE=$MONGO_DATABASE
- MONGO_AUTH_DB=$MONGO_AUTH_DB
ports:
- "3001:3000"
volumes:
- .:/home/node/app
- node_modules:/home/node/app/node_modules
networks:
- app-network
command: node build/index.js
depends_on:
- db
db:
image: mongo:3.6.8
container_name: db
restart: unless-stopped
env_file: .env
ports:
- 27017:27017
environment:
- MONGO_INITDB_ROOT_USERNAME=$MONGO_USERNAME
- MONGO_INITDB_ROOT_PASSWORD=$MONGO_PASSWORD
volumes:
- dbdata:/data/db
networks:
- app-network
networks:
app-network:
driver: bridge
volumes:
dbdata:
node_modules: