-
Notifications
You must be signed in to change notification settings - Fork 311
/
docker-compose.yaml
69 lines (59 loc) · 1.79 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#This file builds the Docker images for a React/NodeJS application and runs it as microservices on Docker containers
#To ensure successful execution, clone this entire repository and execute this file while in the root folder of the cloned repository
#It's also a requirement to have Docker and the docker-compose plugin installed in your environment
#To launch this app without having to clone the entire repository,use the docker-compose.yaml file to run the app
version: "3.8"
services:
#Builds the frontend Docker image and creates the frontend microservice
brian-yolo-client:
image: brianbwire/brian-yolo-client:v1.0.0
build: ./client
container_name: brian-yolo-client
stdin_open: true
tty: true
ports:
- "3000:3000"
depends_on:
- brian-yolo-backend
networks:
- app-net
#Builds the backend Docker image and creates the backend microservice
brian-yolo-backend:
image: brianbwire/brian-yolo-backend:v1.0.0
build: ./backend
container_name: brian-yolo-backend
stdin_open: true
tty: true
restart: always
ports:
- "5000:5000"
depends_on:
- app-ip-mongo
networks:
- app-net
#Creates the database microservice
app-ip-mongo:
image: mongo
container_name: app-mongo
ports:
- "27017:27017"
networks:
- app-net
volumes:
- type: volume
source: app-mongo-data
target: /data/db
#Creates the network infrastructure necessary for the containers to communicate with each other
networks:
app-net:
name: app-net
driver: bridge
attachable: true
ipam:
config:
- subnet: 172.20.0.0/16
ip_range: 172.20.0.0/16
#Creates a Docker volume that persists all the data stored in the database
volumes:
app-mongo-data:
driver: local