forked from fernandohenriques/nestjs-graphql-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
45 lines (41 loc) · 927 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
44
45
version: "3.4"
services:
app:
container_name: app
build:
context: .
dockerfile: ./docker/Dockerfile
args:
- PORT=${PORT}
- NODE_ENV=${NODE_ENV}
user: node
working_dir: /home/node/app
env_file:
- ./.env
volumes:
- ./src:/home/node/app/src
ports:
- ${PORT}:${PORT}
depends_on:
- mongodb
networks:
- mynet
command: "npm run start:dev"
mongodb:
container_name: ${MONGO_HOST}
image: mongo:latest
environment:
- MONGO_INITDB_DATABASE=${MONGO_DATABASE_NAME}
- MONGO_INITDB_ROOT_USERNAME=${MONGO_USERNAME}
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_PASSWORD}
ports:
- ${MONGO_PORT}:${MONGO_PORT}
volumes:
- ./docker/init-mongo.sh:/docker-entrypoint-initdb.d/init-mongo.sh
- mongo-storage:/data/db
networks:
- mynet
volumes:
mongo-storage: {}
networks:
mynet: