job "gitea" { group "gitea" { network { mode = "bridge" port "http" { to = 3000 } } service { connect { sidecar_service { proxy { upstreams { destination_name = "postgres" local_bind_port = 5432 } } } } } service { name = "code" port = "http" tags = [ "traefik.enable=true", "traefik.http.routers.gitea.middlewares=auth@file", # Token subdomain — no auth middleware — used by act_runner step containers for git checkout "traefik.http.routers.gitea-token.rule=Host(`gitea-1ef0bea6b75a4fd3e9393a9f7f7e4b02.othrayte.one`)", ] check { type = "http" path = "/" interval = "10s" timeout = "2s" } } # Separate service for Consul Connect ingress (address_mode=alloc avoids hairpin NAT issue) service { name = "code-connect" port = "http" address_mode = "alloc" connect { sidecar_service {} } } task "gitea" { driver = "docker" config { image = "gitea/gitea:latest" ports = ["http"] volumes = ["local/app.ini:/data/gitea/conf/app.ini"] } env = { USER_UID = "1000" USER_GID = "1000" } resources { cpu = 500 memory = 512 } volume_mount { volume = "unraid_appdata_gitea" destination = "/data" read_only = false } template { data = <