refactor: move traefik configuration to docker-compose files via labels

This commit is contained in:
2025-12-05 04:03:24 +01:00
parent d776124f26
commit fc6a11397b
17 changed files with 356 additions and 74 deletions
+24 -2
View File
@@ -25,11 +25,33 @@ services:
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik-proxy"
# Prod Router
- "traefik.http.routers.gitea.rule=Host(`gitea.forust.xyz`)"
- "traefik.http.routers.gitea.entrypoints=websecure"
- "traefik.http.routers.gitea.middlewares=security-headers"
- "traefik.http.routers.gitea.service=gitea"
- "traefik.http.routers.gitea.tls=true"
- "traefik.http.services.gitea.loadbalancer.server.port=3000"
# Local Router
- "traefik.http.routers.gitea-local.rule=Host(`gitea.workstation.local`) || Host(`gitea.local`)"
- "traefik.http.routers.gitea-local.entrypoints=websecure"
- "traefik.http.routers.gitea-local.middlewares=security-headers"
- "traefik.http.routers.gitea-local.service=gitea"
- "traefik.http.routers.gitea-local.tls=true"
# Dev Router
- "traefik.http.routers.gitea-dev.rule=Host(`gitea.gigaforust.local`)"
- "traefik.http.routers.gitea-dev.entrypoints=websecure"
- "traefik.http.routers.gitea-dev.middlewares=security-headers"
- "traefik.http.routers.gitea-dev.service=gitea"
- "traefik.http.routers.gitea-dev.tls=true"
ports:
- "2221:22"
depends_on:
- db
db:
image: docker.io/library/postgres:14
restart: always
@@ -41,7 +63,7 @@ services:
- gitea-db
volumes:
- ./gitea-db/:/var/lib/postgresql/data
networks:
gitea-db:
external: false