The cache-server subcommand only checks the literal external_secret field at startup and errors out if just external_secret_file is set (unlike the daemon, which handles _file fine). Move its config out of git entirely - it now has to hold the actual secret value - generated straight into .data on the VPS instead.
144 lines
7.7 KiB
YAML
144 lines
7.7 KiB
YAML
services:
|
|
gitea:
|
|
image: gitea/gitea:latest
|
|
container_name: gitea
|
|
environment:
|
|
TZ: ${TIMEZONE:-Europe/Amsterdam}
|
|
USER_UID: 1000
|
|
USER_GID: 1000
|
|
GITEA__APP_NAME: dev.pivoine.art
|
|
GITEA__database__DB_TYPE: postgres
|
|
GITEA__database__HOST: gitea_db:5432
|
|
GITEA__database__NAME: gitea
|
|
GITEA__database__USER: gitea
|
|
GITEA__database__PASSWD: gitea
|
|
GITEA__server__DOMAIN: ${TRAEFIK_HOST}
|
|
GITEA__server__SSH_DOMAIN: ${TRAEFIK_HOST}
|
|
GITEA__server__ROOT_URL: https://${TRAEFIK_HOST}/
|
|
GITEA__server__PROTOCOL: http
|
|
GITEA__server__HTTP_PORT: 3000
|
|
GITEA__server__START_SSH_SERVER: "true"
|
|
GITEA__server__SSH_PORT: 22
|
|
GITEA__server__SSH_LISTEN_PORT: 2222
|
|
GITEA__server__LANDING_PAGE: /valknar
|
|
GITEA__mailer__ENABLED: "true"
|
|
GITEA__mailer__PROTOCOL: smtp
|
|
GITEA__mailer__SMTP_ADDR: mailpit
|
|
GITEA__mailer__SMTP_PORT: 1025
|
|
GITEA__mailer__FROM: ${EMAIL_FROM}
|
|
GITEA__mailer__USER: ${EMAIL_USER}
|
|
GITEA__service__DISABLE_REGISTRATION: "true"
|
|
GITEA__service__REQUIRE_SIGNIN_VIEW: "false"
|
|
GITEA__service__ENABLE_NOTIFY_MAIL: "true"
|
|
GITEA__service__DEFAULT_EMAIL_NOTIFICATIONS: enabled
|
|
GITEA__packages__ENABLED: "true"
|
|
GITEA__actions__ENABLED: "true"
|
|
GITEA__ui__THEMES: gitea-auto,gitea-light,gitea-dark,catppuccin-latte-rosewater,catppuccin-latte-flamingo,catppuccin-latte-pink,catppuccin-latte-mauve,catppuccin-latte-red,catppuccin-latte-maroon,catppuccin-latte-peach,catppuccin-latte-yellow,catppuccin-latte-green,catppuccin-latte-teal,catppuccin-latte-sky,catppuccin-latte-sapphire,catppuccin-latte-blue,catppuccin-latte-lavender,catppuccin-frappe-rosewater,catppuccin-frappe-flamingo,catppuccin-frappe-pink,catppuccin-frappe-mauve,catppuccin-frappe-red,catppuccin-frappe-maroon,catppuccin-frappe-peach,catppuccin-frappe-yellow,catppuccin-frappe-green,catppuccin-frappe-teal,catppuccin-frappe-sky,catppuccin-frappe-sapphire,catppuccin-frappe-blue,catppuccin-frappe-lavender,catppuccin-macchiato-rosewater,catppuccin-macchiato-flamingo,catppuccin-macchiato-pink,catppuccin-macchiato-mauve,catppuccin-macchiato-red,catppuccin-macchiato-maroon,catppuccin-macchiato-peach,catppuccin-macchiato-yellow,catppuccin-macchiato-green,catppuccin-macchiato-teal,catppuccin-macchiato-sky,catppuccin-macchiato-sapphire,catppuccin-macchiato-blue,catppuccin-macchiato-lavender,catppuccin-mocha-rosewater,catppuccin-mocha-flamingo,catppuccin-mocha-pink,catppuccin-mocha-mauve,catppuccin-mocha-red,catppuccin-mocha-maroon,catppuccin-mocha-peach,catppuccin-mocha-yellow,catppuccin-mocha-green,catppuccin-mocha-teal,catppuccin-mocha-sky,catppuccin-mocha-sapphire,catppuccin-mocha-blue,catppuccin-mocha-lavender,catppuccin-rosewater-auto,catppuccin-flamingo-auto,catppuccin-pink-auto,catppuccin-mauve-auto,catppuccin-red-auto,catppuccin-maroon-auto,catppuccin-peach-auto,catppuccin-yellow-auto,catppuccin-green-auto,catppuccin-teal-auto,catppuccin-sky-auto,catppuccin-sapphire-auto,catppuccin-blue-auto,catppuccin-lavender-auto
|
|
GITEA__ui__DEFAULT_THEME: catppuccin-frappe-blue
|
|
GITEA__ui__ENABLE_FEED: "true"
|
|
ports:
|
|
- "${VPS_IPV4}:22:2222"
|
|
volumes:
|
|
- ../.data/gitea/data:/data
|
|
- ../.data/gitea/config:/etc/gitea
|
|
- ./css:/data/gitea/public/assets/css:ro
|
|
- ./templates/custom:/data/gitea/templates/custom:ro
|
|
- /etc/localtime:/etc/localtime:ro
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
restart: always
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.middlewares.gitea-redirect-web-secure.redirectscheme.scheme=https"
|
|
- "traefik.http.routers.gitea-web.middlewares=gitea-redirect-web-secure"
|
|
- "traefik.http.routers.gitea-web.rule=Host(`${TRAEFIK_HOST}`)"
|
|
- "traefik.http.routers.gitea-web.entrypoints=web"
|
|
- "traefik.http.routers.gitea-web-secure.rule=Host(`${TRAEFIK_HOST}`)"
|
|
- "traefik.http.routers.gitea-web-secure.tls.certresolver=resolver"
|
|
- "traefik.http.routers.gitea-web-secure.entrypoints=web-secure"
|
|
- "traefik.http.routers.gitea-web-secure.middlewares=security-headers@file,rate-limit@file"
|
|
- "traefik.http.services.gitea-web-secure.loadbalancer.server.port=3000"
|
|
- "traefik.docker.network=${NETWORK_NAME}"
|
|
networks:
|
|
- compose_network
|
|
runner:
|
|
image: gitea/act_runner:latest
|
|
container_name: gitea_runner
|
|
privileged: true
|
|
command: ["act_runner", "daemon", "--config", "/data/config.yaml"]
|
|
environment:
|
|
TZ: ${TIMEZONE:-Europe/Amsterdam}
|
|
GITEA_INSTANCE_URL: https://${TRAEFIK_HOST}
|
|
GITEA_RUNNER_REGISTRATION_TOKEN: ${RUNNER_TOKEN}
|
|
GITEA_RUNNER_NAME: docker-runner
|
|
GITEA_RUNNER_LABELS: ubuntu-latest:docker://catthehacker/ubuntu:act-latest,ubuntu-22.04:docker://catthehacker/ubuntu:act-22.04,ubuntu-20.04:docker://catthehacker/ubuntu:act-20.04
|
|
DOCKER_HOST: unix:///var/run/docker.sock
|
|
# Lets this container itself resolve host.docker.internal too (used by
|
|
# cache.external_server in runner-config.yaml) - the daemon needs this
|
|
# for its own pre-registration calls to runner-cache-server, separately
|
|
# from job containers (which get it via container.options's --add-host).
|
|
extra_hosts:
|
|
- "host.docker.internal:host-gateway"
|
|
volumes:
|
|
- ../.data/gitea/runner:/data
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
- ./runner-config.yaml:/data/config.yaml:ro
|
|
- ../.data/gitea/cache_secret:/data/cache_secret:ro
|
|
restart: always
|
|
networks:
|
|
- compose_network
|
|
runner-cache-server:
|
|
image: gitea/act_runner:latest
|
|
container_name: gitea_runner_cache
|
|
# The image's default entrypoint (run.sh) ignores any command args and
|
|
# always registers-then-execs `act_runner daemon` regardless - it has no
|
|
# cache-server mode. Bypass it entirely and invoke act_runner directly.
|
|
entrypoint: ["/sbin/tini", "--"]
|
|
command: ["act_runner", "cache-server", "--config", "/data/config.yaml", "--host", "0.0.0.0", "--port", "8088", "--dir", "/data/cache"]
|
|
environment:
|
|
TZ: ${TIMEZONE:-Europe/Amsterdam}
|
|
ports:
|
|
# Published so job containers - isolated on their own per-task Docker
|
|
# network, unreachable via container name regardless of network
|
|
# settings we tried - can still reach it via host.docker.internal,
|
|
# which resolves to their own network's gateway and routes back to
|
|
# this published port. Exposed on the VPS's public interface too;
|
|
# requests without a valid job's bearer token are rejected, but
|
|
# consider a firewall rule restricting this to Docker's private
|
|
# bridge ranges (172.16.0.0/12) if that's a concern.
|
|
- "8088:8088"
|
|
volumes:
|
|
- ../.data/gitea/runner-cache:/data/cache
|
|
# Unlike the daemon (runner-config.yaml, external_secret_file works
|
|
# fine there), the cache-server subcommand only checks the literal
|
|
# external_secret field and errors out ("must be set") if only
|
|
# external_secret_file is given. So this file has to hold the actual
|
|
# secret value - kept out of git entirely, generated straight into
|
|
# .data on the VPS (see the cache_secret file it reads from).
|
|
- ../.data/gitea/cache-server-config.yaml:/data/config.yaml:ro
|
|
restart: always
|
|
networks:
|
|
- compose_network
|
|
db:
|
|
image: postgres:16-alpine
|
|
container_name: gitea_db
|
|
environment:
|
|
POSTGRES_DB: gitea
|
|
POSTGRES_USER: gitea
|
|
POSTGRES_PASSWORD: gitea
|
|
volumes:
|
|
- ../.data/gitea/db:/var/lib/postgresql/data
|
|
restart: always
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks:
|
|
- compose_network
|
|
networks:
|
|
compose_network:
|
|
name: ${NETWORK_NAME}
|
|
external: true
|