This commit is contained in:
2025-01-16 00:17:11 +01:00
committed by Kevin Midboe
commit b4f3ec3343
13 changed files with 621 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
# version: "3.9"
services:
webapp:
image: nginx:alpine
container_name: webapp
labels:
- "traefik.enable=true"
- "traefik.http.routers.webapp.rule=Host(`webapp.localhost`)"
- "traefik.http.routers.webapp.entrypoints=web"
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
- "traefik.http.routers.webapp.middlewares=redirect-to-https"
- "traefik.http.routers.webapp.tls=true"
- "traefik.http.services.webapp.loadbalancer.server.port=80"
backend:
image: my-backend-app:latest
container_name: backend
labels:
- "traefik.enable=true"
- "traefik.http.routers.backend.rule=Host(`backend.localhost`)"
- "traefik.http.routers.backend.entrypoints=web"
- "traefik.http.routers.backend.tls=true"
- "traefik.http.services.backend.loadbalancer.server.port=5000" # Port exposed by the backend app

24
assets/docker-compose.yml Normal file
View File

@@ -0,0 +1,24 @@
version: "3.9"
services:
webapp:
image: nginx:alpine
container_name: webapp
labels:
- "traefik.enable=true"
- "traefik.http.routers.webapp.rule=Host(`webapp.localhost`)"
- "traefik.http.routers.webapp.entrypoints=web"
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
- "traefik.http.routers.webapp.middlewares=redirect-to-https"
- "traefik.http.routers.webapp.tls=true"
- "traefik.http.services.webapp.loadbalancer.server.port=80"
backend:
image: my-backend-app:latest
container_name: backend
labels:
- "traefik.enable=true"
- "traefik.http.routers.backend.rule=Host(`backend.localhost`)"
- "traefik.http.routers.backend.entrypoints=web"
- "traefik.http.routers.backend.tls=true"
- "traefik.http.services.backend.loadbalancer.server.port=5000" # Port exposed by the backend app

34
assets/dynamic.yml Normal file
View File

@@ -0,0 +1,34 @@
http:
routers:
request-router:
rule: "Host(`request.test`)"
service: request-service
entryPoints:
- web
services:
request-service:
loadBalancer:
servers:
- url: "http://seasoned.schleppe:5000"
weight: 100
passHostHeader: true
mirrored-service:
mirroring:
service: example-service
mirrorBody: true
maxBodySize: 1024
mirrors:
- name: mirror1
percent: 10
url: http://example.com
- name: mirror2
percent: 20
url: http://example.org
healthCheck:
service: "request-service"
middlewares:
redirect-to-https:
redirectScheme:
permanent: false
scheme: https