Replace all hardcoded lazyworkhorse.net references in compose files
with ${DOMAIN} variable substitution. Create .env.production and
.env.staging environment files. Update Makefile with ENV selection
(--env-file support) and staging/production targets.
Changes:
- All 13 compose YAML files: lazyworkhorse.net -> ${DOMAIN}
- New .env.production (DOMAIN=lazyworkhorse.net)
- New .env.staging (DOMAIN=staging.lazyworkhorse.net)
- Makefile: ENV var, --env-file flag, staging/production targets
- Gitea redirect regex updated for variable substitution
- CI workflow checkout URLs left hardcoded (infrastructure refs)
- Dockerfile SSH host refs left hardcoded (infrastructure refs)
Deploy: make ENV=staging all_up or make staging
make ENV=production all_up or make production
65 lines
2.2 KiB
YAML
65 lines
2.2 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.${DOMAIN}
|
|
- GITEA__actions__ENABLED=true
|
|
- SSH_PORT=2222
|
|
- SSH_LISTEN_PORT=2222
|
|
# Enable Gitea Actions (act_runner required on host)
|
|
- GITEA__actions__ENABLED=true
|
|
volumes:
|
|
- /mnt/HoardingCow_docker_data/Gitea:/data
|
|
networks:
|
|
- vc_net
|
|
restart: always
|
|
ports:
|
|
- "2222:2222"
|
|
labels:
|
|
- "traefik.enable=true"
|
|
|
|
# HTTP -> HTTPS Redirect
|
|
- "traefik.http.routers.gitea-http.rule=Host(`code.${DOMAIN}`)"
|
|
- "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.${DOMAIN}`)"
|
|
- "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\.${DOMAIN}/?$$'
|
|
- 'traefik.http.middlewares.gitea-home-redirect.redirectregex.replacement=https://code.${DOMAIN}/gortium'
|
|
- "traefik.http.middlewares.gitea-home-redirect.redirectregex.permanent=true"
|
|
|
|
# Internal Routing
|
|
- "traefik.http.services.gitea.loadbalancer.server.port=3000"
|
|
|
|
act_runner:
|
|
image: gitea/act_runner:latest
|
|
container_name: act_runner
|
|
environment:
|
|
- GITEA_INSTANCE_URL=https://code.${DOMAIN}
|
|
- GITEA_RUNNER_REGISTRATION_TOKEN=${GITEA_RUNNER_TOKEN}
|
|
- GITEA_RUNNER_NAME=ai-host-runner
|
|
- GITEA_RUNNER_LABELS=ubuntu-latest:docker://catthehacker/ubuntu:full-22.04,nixos-builder:docker://nixos/nix
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
networks:
|
|
- vc_net
|
|
restart: always
|
|
depends_on:
|
|
- gitea
|
|
|
|
networks:
|
|
vc_net:
|
|
external: true
|