-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
147 lines (136 loc) · 3.42 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
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
version: '3.9'
services:
#Ping Pong Application
ping_pong_application:
build:
context: ./Application/Ping_Pong_Application
dockerfile: Ping_Pong_Application_Dockerfile
# args:
# ping_pong_application_port: 8000
container_name: ping_pong_application
restart: unless-stopped
tty: true
expose:
- 8000
ports:
- "8000:8000"
networks:
- reverse-proxy-network
deploy:
resources:
limits:
#(50% of a single core) of available processing time (CPU)
cpus: '0.50'
# to use no more than 50M of memory (RAM)
memory: 50M
reservations:
# CPU time reserved for the container
cpus: '0.25'
# 20M of memory
memory: 20M
#Sakila Manager Application
sakila_manager:
build:
context: ./Application/Sakila_Manager
dockerfile: Sakila_Manager_Dockerfile
# args:
# sakila_manager_port: 5000
container_name: sakila_manager
links:
- database:database
depends_on:
- database
restart: unless-stopped
tty: true
expose:
- 5000
ports:
- "5000:5000"
volumes:
- ./Application/Sakila_Manager/Download_Folder:/usr/src/app/Download_Folder
networks:
- reverse-proxy-network
- db-network
deploy:
resources:
limits:
#(100% of a single core) of available processing time (CPU)
cpus: '1'
# to use no more than 1000M of memory (RAM)
memory: 1000M
reservations:
# CPU time reserved for the container
cpus: '0.25'
# 500M of memory
memory: 500M
#Nginx Service
reverse_proxy:
build:
context: ./Reverse_Proxy
dockerfile: Reverse_Proxy_Dockerfile
# args:
# reverse_proxy_main_port: 80
# reverse_proxy_port_one: 9001
# reverse_proxy_port_two: 9002
depends_on:
- database
- ping_pong_application
- sakila_manager
container_name: reverse_proxy
restart: unless-stopped
tty: true
ports:
# - "80:80"
- "9001:9001"
- "9002:9002"
volumes:
- ./Reverse_Proxy/nginx.conf:/etc/nginx/nginx.conf
- ./Reverse_Proxy/conf.d/default.conf:/etc/nginx/conf.d/default.conf
- ./Reverse_Proxy/conf.d/ping_pong.conf:/etc/nginx/conf.d/ping_pong.conf
- ./Reverse_Proxy/conf.d/sakila_manager.conf:/etc/nginx/conf.d/sakila_manager.conf
networks:
- reverse-proxy-network
deploy:
resources:
limits:
cpus: '0.50'
memory: 50M
reservations:
cpus: '0.25'
memory: 20M
#MySQL Database Service
database:
build:
context: ./Database
dockerfile: Database_Dockerfile
# args:
# database_root_password: ramz
# database_name: sakila
# database_user: sakila_app
# database_port: 3306
container_name: sakila_database
restart: unless-stopped
environment:
MYSQL_DATABASE: sakila
MYSQL_USER: sakila_app
MYSQL_PASSWORD: ramz
MYSQL_ROOT_PASSWORD: ramz
tty: true
ports:
- "3306:3306"
volumes:
- ./Database/database_volume:/var/lib/mysql/
networks:
- db-network
deploy:
resources:
reservations:
cpus: '2'
memory: 200M
#Docker Networks
networks:
reverse-proxy-network:
driver: bridge
db-network:
driver: bridge
#Volumes