Skip to content

Commit

Permalink
create a load-balancer
Browse files Browse the repository at this point in the history
  • Loading branch information
SquidRings1 committed Dec 4, 2024
1 parent ee442ac commit 8327121
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
17 changes: 16 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,19 @@ services:
todolist:
build : . # (1)
ports:
- 8081:8080 # (2)
- 8080 # (2)
deploy:
replicas: 3
labels:
- "traefik.http.routers.todolist.rule=PathPrefix(`/app`)"
- "traefik.http.middlewares.todolist.stripPrefix.prefixes=/app"
- "traefik.http.routers.todolist.middlewares=todolist@docker"
traefik:
image: traefik:2.5
restart: unless-stopped
ports:
- 80:80
- 8080:8080
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./traefik.toml:/traefik.toml
24 changes: 24 additions & 0 deletions traefik.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[global]
sendAnonymousUsage = false

[accessLog]

[log]
level = "DEBUG"
format = "common"

[providers]
[providers.docker]
endpoint = "unix:///var/run/docker.sock"
watch = true
exposedByDefault = true
swarmMode = false

[api]
dashboard = true
debug = false
insecure = true

[entryPoints]
[entryPoints.insecure]
address = ":80"

0 comments on commit 8327121

Please sign in to comment.