-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
executable file
·52 lines (48 loc) · 1.01 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
version: '3'
services:
nodejs:
build:
context: ./
dockerfile: Dockerfile
depends_on:
- db
image: nodejs
container_name: nodejs
restart: unless-stopped
env_file: .env
environment:
- MONGO_USERNAME=$MONGO_USERNAME
- MONGO_PASSWORD=$MONGO_PASSWORD
- MONGO_HOSTNAME=$MONGO_HOSTNAME
- MONGO_PORT=$MONGO_PORT
- MONGO_DB=$MONGO_DB
ports:
- "8080:8080"
volumes:
- .:/home/node/app
- logs:/home/node/app/src/logs
- node_modulesv:/home/node/app/node_modules
networks:
- app-network
command: npm run dev
db:
image: mongo:4.1.8-xenial
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:
logs:
node_modulesv: