Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
ToDo-App Jan Schnaidt and Abdullah Kiran
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Abdullah Kiran
ToDo-App Jan Schnaidt and Abdullah Kiran
Commits
87972788
Commit
87972788
authored
6 months ago
by
Jan Schnaidt
Browse files
Options
Downloads
Patches
Plain Diff
Load balancer
parent
ed697e34
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Caddyfile
+5
-3
5 additions, 3 deletions
Caddyfile
docker-compose.yml
+7
-4
7 additions, 4 deletions
docker-compose.yml
src/main/java/com/cloudcomputing/todo/controller/HealthController.java
+14
-0
14 additions, 0 deletions
.../com/cloudcomputing/todo/controller/HealthController.java
with
26 additions
and
7 deletions
Caddyfile
+
5
−
3
View file @
87972788
...
@@ -2,8 +2,10 @@
...
@@ -2,8 +2,10 @@
root * /usr/share/caddy
root * /usr/share/caddy
file_server
file_server
reverse_proxy /user* {
reverse_proxy /user* backend1:9876 backend2:9877 {
to backend_1:9876 backend_2:9877
lb_policy first
lb_policy round_robin
health_uri /health
health_interval 10s
health_timeout 1s
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
docker-compose.yml
+
7
−
4
View file @
87972788
...
@@ -24,8 +24,8 @@ services:
...
@@ -24,8 +24,8 @@ services:
networks
:
networks
:
-
todo-network
-
todo-network
# backend
stuff
# backend
1
backend
_
1
:
backend1
:
# builds backend from root
# builds backend from root
build
:
.
build
:
.
# the internal network our backend will be using
# the internal network our backend will be using
...
@@ -46,8 +46,8 @@ services:
...
@@ -46,8 +46,8 @@ services:
depends_on
:
depends_on
:
-
mongodb
-
mongodb
# backend
stuff
# backend
2
backend
_
2
:
backend2
:
# builds backend from root
# builds backend from root
build
:
.
build
:
.
# the internal network our backend will be using
# the internal network our backend will be using
...
@@ -79,6 +79,7 @@ services:
...
@@ -79,6 +79,7 @@ services:
networks
:
networks
:
-
todo-network
-
todo-network
# caddy for load balancing and reverse proxying
# caddy for load balancing and reverse proxying
caddy
:
caddy
:
image
:
caddy/caddy:alpine
image
:
caddy/caddy:alpine
...
@@ -90,6 +91,8 @@ services:
...
@@ -90,6 +91,8 @@ services:
-
"
80:80"
# default http port
-
"
80:80"
# default http port
networks
:
networks
:
-
todo-network
-
todo-network
depends_on
:
-
frontend
# were gonna use this network for both our backend and frontend
# were gonna use this network for both our backend and frontend
networks
:
networks
:
...
...
This diff is collapsed.
Click to expand it.
src/main/java/com/cloudcomputing/todo/controller/HealthController.java
0 → 100644
+
14
−
0
View file @
87972788
package
com.cloudcomputing.todo.controller
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
public
class
HealthController
{
@GetMapping
(
"/health"
)
public
ResponseEntity
<
Boolean
>
health
()
{
return
ResponseEntity
.
ok
(
true
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment