Skip to content

Commit

Permalink
Add test load balancer
Browse files Browse the repository at this point in the history
Signed-off-by: Bensuperpc <[email protected]>
  • Loading branch information
bensuperpc committed Aug 28, 2024
1 parent 5b48945 commit b819c43
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 7 deletions.
14 changes: 10 additions & 4 deletions infrastructure/caddy/config/bensuperpc.org/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ wordpress.bensuperpc.org {
}
}

it-tools.bensuperpc.org {
# Load balance between 2 instances
reverse_proxy {
to it-tools0:80 it-tools1:80
lb_policy round_robin
lb_retries 3
lb_try_interval 1s
}
}

adminer.bensuperpc.org {
reverse_proxy adminer:8080
}
Expand Down Expand Up @@ -97,10 +107,6 @@ syncthing.bensuperpc.org {
}
}

it-tools.bensuperpc.org {
reverse_proxy it-tools:80
}

tools.bensuperpc.org {
redir https://it-tools.bensuperpc.org permanent
}
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/homepage/config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
href: https://it-tools.bensuperpc.org/
description: IT Tools
ping: it-tools.bensuperpc.org
container: it-tools
container: it-tools0

- gitea:
icon: https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons@master/png/gitea.png
Expand Down
25 changes: 23 additions & 2 deletions infrastructure/it-tools/docker-compose.it-tools.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
services:
# it-tools
it-tools:
it-tools0:
image: corentinth/it-tools:latest
container_name: it-tools
container_name: it-tools0
profiles:
- it-tools
restart: on-failure:5
depends_on:
- caddy
networks:
- infra-network
security_opt:
- no-new-privileges:true
read_only: false
deploy:
resources:
limits:
cpus: '0.5'
memory: 512M
reservations:
cpus: '0.001'
memory: 20M
it-tools1:
image: corentinth/it-tools:latest
container_name: it-tools1
profiles:
- it-tools
restart: on-failure:5
Expand Down

0 comments on commit b819c43

Please sign in to comment.