-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
41 lines (35 loc) · 942 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
# Use docker-compose syntax Version 2
version: "2"
services:
# Our main "nodeapp" service which has the express aplication inside
nodeapp1:
build:
# Look for the Dockerfile inside the "nodeapp" folder
context: ./nodeapp
dockerfile: Dockerfile
restart: always
ports:
- "80"
networks:
- front-tier
# Our replicas of the main "nodeapp", just so that NGINX can load-balance
# E.g when there's a new version available of our app
# We'll take each one of these 3 services done, update them and bring them back up 1-by-1
nodeapp2:
extends:
service: nodeapp1
nodeapp3:
extends:
service: nodeapp1
# NGINX will reverse proxy the express application
nginx:
build: ./nginx
restart: always
# Bind port 80 in the service to port 80 on the host
ports:
- "80:80"
networks:
- front-tier
networks:
front-tier:
driver: bridge