-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
44 lines (44 loc) · 1.25 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
# Docker version
version: "3"
# Container will be used
services:
# Container name that be creted
mongo:
# Container name
container_name: mongo-container
# This container will come from this image
# mongodb version 4
image: mongo:4
# Case down mongodb, restart him
restart: always
# Is array, persist the data, from data to data/db docker
volumes:
- ./data:/data/db
# Mapping port from mongodb local to mongodb docker
ports:
- "27017:27017"
# Up clean-node-api
api:
container_name: api-container
# Docker node version
image: node:14
# local dir from project
working_dir: /usr/src/clean-node-api
restart: always
# Install dependencies and before run debug (on final)
command: bash -c "npm install && npm run debug"
# Set environment MONGO_URL to mongodb docker
environment:
- MONGO_URL=mongodb://mongo:27017/clean-node-api
# WORKDIR path of project build
volumes:
# The last "/" means that whatever is fixed, as in the
# container's dist
- ./dist/:/usr/src/clean-node-api/dist/
- ./package.json:/usr/src/clean-node-api/package.json
ports:
- "3333:3333"
- "9222:9222"
# Link access api with mongo
links:
- mongo