2026-06-29 21:56:12 -05:00
|
|
|
# docker-compose.example.yml — custom-gitea-runner deployment
|
|
|
|
|
# Copy and adjust for your environment. Use pinned image tags in production.
|
|
|
|
|
#
|
|
|
|
|
# Modes:
|
|
|
|
|
# Mode A (pre-generated config): mount config/runner.yaml — set RUNNER_CONFIG_PATH
|
|
|
|
|
# Mode B (bootstrap on first run): set GITEA_INSTANCE_URL, GITEA_RUNNER_TOKEN, GITEA_RUNNER_NAME
|
|
|
|
|
|
|
|
|
|
services:
|
|
|
|
|
gitea-runner:
|
2026-06-29 22:18:38 -05:00
|
|
|
image: registry.alwisp.com/jason/custom-gitea-runner:v0.1.0 # pin your version here (Gitea CR requires the owner namespace)
|
2026-06-29 21:56:12 -05:00
|
|
|
container_name: gitea-runner
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
|
|
|
|
|
environment:
|
|
|
|
|
# ── Required for Mode B (bootstrap registration) ───────────────────────
|
|
|
|
|
GITEA_INSTANCE_URL: https://git.example.com
|
|
|
|
|
GITEA_RUNNER_NAME: unraid-runner-01
|
|
|
|
|
GITEA_RUNNER_TOKEN: ${GITEA_RUNNER_TOKEN} # set in .env file
|
|
|
|
|
|
|
|
|
|
# ── Optional ──────────────────────────────────────────────────────────
|
2026-06-29 22:18:38 -05:00
|
|
|
# `host` runs steps in the runner container (Docker CLI + socket available),
|
|
|
|
|
# needed for docker build/push. `ubuntu-latest` runs in a clean node container.
|
|
|
|
|
GITEA_RUNNER_LABELS: ubuntu-latest:docker://node:20-bullseye,host:host
|
2026-06-29 21:56:12 -05:00
|
|
|
RUNNER_CONFIG_PATH: /config/runner.yaml
|
|
|
|
|
RUNNER_WORKDIR: /work
|
|
|
|
|
TZ: America/Chicago
|
|
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
|
# Runner config (persisted across restarts; generated on first boot in Mode B)
|
|
|
|
|
- ./config:/config
|
|
|
|
|
|
|
|
|
|
# Job workspace (writable scratch space for running jobs)
|
|
|
|
|
- ./work:/work
|
|
|
|
|
|
|
|
|
|
# Docker socket — required for docker build/push workflows
|
|
|
|
|
# Grants the runner full Docker daemon access. Understand the trust model.
|
|
|
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
|
|
|
|
|
|
|
|
# Limit resources to avoid runaway jobs starving the host
|
|
|
|
|
deploy:
|
|
|
|
|
resources:
|
|
|
|
|
limits:
|
|
|
|
|
cpus: "4"
|
|
|
|
|
memory: 4G
|
|
|
|
|
|
|
|
|
|
logging:
|
|
|
|
|
driver: json-file
|
|
|
|
|
options:
|
|
|
|
|
max-size: "10m"
|
|
|
|
|
max-file: "3"
|