-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
42 lines (38 loc) · 836 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
version: '3.7'
services:
# REST API running on Node JS container
app:
container_name: lafs-api
restart: always
build: .
ports:
- '3000:3000'
# Link this container to the Mongo DB container
links:
- mongo
# Pass in environment variables for database host and name
environment:
- DB_HOST=mongo
- DB_NAME=lafs-db
# Attach the external network to this container
networks:
- lafs-net
# MongoDB storage container
mongo:
container_name: lafs-db
image: 'mongo:4'
ports:
- '27017:27017'
# Attach the external network to this container
networks:
- lafs-net
# Persist MongoDB data
volumes:
- mongo-data:/data/db
# Define external network
networks:
lafs-net:
external: true
# Define volumes
volumes:
mongo-data: