Commit 10c9dab3 authored by mohammad.salama's avatar mohammad.salama

Initial commit

parents
global
maxconn 4096
defaults
mode http
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
frontend main
bind *:8080
default_backend backend
backend backend
balance roundrobin
server greeter-1 172.19.0.3:8001
server greeter-2 172.19.0.2:8002
FROM openjdk:17
WORKDIR /app
COPY . /app/
CMD ["java", "-jar", "WebServer.jar" , "8001"]
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>Hello from Server "1"</title>
<style>
body, html {
height: 100%;
margin: 0;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
}
.flashy-text {
font-size: 48px;
animation: flash 2s infinite;
}
@keyframes flash {
0% { opacity: 1; }
50% { opacity: 0; }
100% { opacity: 1; }
}
</style>
</head>
<body>
<div class="flashy-text">
Hello from Server "1 - One"
</div>
</body>
</html>
\ No newline at end of file
FROM openjdk:17
WORKDIR /app
COPY . /app/
CMD ["java", "-jar", "WebServer.jar" , "8002"]
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>Hello from Server "2"</title>
<style>
body, html {
height: 100%;
margin: 0;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
}
.flashy-text {
font-size: 48px;
animation: flash 2s infinite;
}
@keyframes flash {
0% { opacity: 1; }
50% { opacity: 0; }
100% { opacity: 1; }
}
</style>
</head>
<body>
<div class="flashy-text">
Hello from Server "2 - Two"
</div>
</body>
</html>
\ No newline at end of file
version: '3'
services:
first-greeting:
image: first-greeter
ports:
- "8001:8001"
second-greeting:
image: second-greeter
ports:
- "8002:8002"
load-balancer:
image: haproxy
ports:
- "8080:8080"
volumes:
- ./Load-Balancer/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
depends_on:
- first-greeting
- second-greeting
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment