-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
54 lines (45 loc) · 1.41 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
54
# docker compose version which is currently 3.8
version: "3.8"
# services : is a list of our container
services:
# name is optional for our mongodb
mymongodb:
# since mongo is an offical image we can use it.
image: "mongo"
# the port that we want to publish for mongodb
ports:
- "27017:27017"
# our mongodb depends on volume to keep the data alive.
volumes:
- data:/data/db
# name is optional for our backend
backend:
# to build an image based on Dockerfile
# it looks in this folder to find Dockerfile to build an image
build: ./backend
# the port that we want to publish for backend
ports:
- "5000:5000"
# depends_on means it will start our backend container once mongo-container is up and running.
depends_on:
- mymongodb
# name is optional for our frontend
frontend:
# to build an image based on Dockerfile
# it looks in this folder to find Dockerfile to build an image
build: ./frontend
# the port that we want to publish for frontend
ports:
- "3000:3000"
# add bind mount volume to keep have updated source code
volumes:
- ./frontend/src:/app/src
# allow interactive mode
stdin_open: true
tty: true
# it will start our frontend container once backend-container is up and running.
depends_on:
- backend
# declare the volumes name that our app is using.
volumes:
data: