Files
compose/versioncontrol/compose.yml
2026-02-22 18:35:22 -05:00

46 lines
1.6 KiB
YAML

version: "3.9"
services:
gitea:
image: gitea/gitea:latest
container_name: gitea
environment:
- USER_UID=1000
- USER_GID=1000
- GITEA__server__ROOT_URL=https://code.lazyworkhorse.net
- SSH_PORT=2222
- SSH_LISTEN_PORT=2222
volumes:
- /mnt/HoardingCow_docker_data/Gitea:/data
networks:
- traefik-net
restart: unless-stopped
ports:
- "2222:2222"
labels:
- "traefik.enable=true"
# HTTP -> HTTPS Redirect
- "traefik.http.routers.gitea-http.rule=Host(`code.lazyworkhorse.net`)"
- "traefik.http.routers.gitea-http.entrypoints=web"
- "traefik.http.routers.gitea-http.middlewares=redirect-to-https"
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
# HTTPS Router
- "traefik.http.routers.gitea-https.rule=Host(`code.lazyworkhorse.net`)"
- "traefik.http.routers.gitea-https.entrypoints=websecure"
- "traefik.http.routers.gitea-https.tls=true"
- "traefik.http.routers.gitea-https.tls.certresolver=njalla"
- "traefik.http.routers.gitea-https.middlewares=gitea-home-redirect"
# The Redirect Logic - Using single quotes to allow backslashes
- 'traefik.http.middlewares.gitea-home-redirect.redirectregex.regex=^https://code\.lazyworkhorse\.net/?$$'
- 'traefik.http.middlewares.gitea-home-redirect.redirectregex.replacement=https://code.lazyworkhorse.net/gortium'
- "traefik.http.middlewares.gitea-home-redirect.redirectregex.permanent=true"
# Internal Routing
- "traefik.http.services.gitea.loadbalancer.server.port=3000"
networks:
traefik-net:
external: true