Gitea Act Runner: DinD stack with cache + parallel jobs

Stable docker-compose setup for building Rust projects on Gitea Actions.
DinD-isolated daemon, built-in cache server, capacity=4 parallel jobs,
healthcheck-gated startup. Portable to other build machines via .env.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HU4wDwdydNZpR3YkMiYYy8
This commit is contained in:
2026-06-30 12:08:05 +07:00
co-authored by Claude Opus 4.8
commit 6ca26d2309
7 changed files with 190 additions and 0 deletions
+51
View File
@@ -0,0 +1,51 @@
services:
# Isolated Docker daemon for the runner's job containers.
# Keeps the host Docker clean and gives reliable cache networking.
dind:
image: docker:27-dind
container_name: gitea-runner-dind
privileged: true
restart: unless-stopped
command: ["dockerd", "--host=tcp://0.0.0.0:2375", "--host=unix:///var/run/docker.sock", "--tls=false"]
environment:
DOCKER_TLS_CERTDIR: ""
networks:
- runner
volumes:
# Persist pulled job images + docker layer cache => fast Rust rebuilds.
- dind-storage:/var/lib/docker
healthcheck:
test: ["CMD", "docker", "info"]
interval: 5s
timeout: 3s
retries: 10
start_period: 10s
runner:
image: docker.io/gitea/act_runner:nightly
container_name: gitea-runner-wsl
restart: unless-stopped
depends_on:
dind:
condition: service_healthy
networks:
- runner
environment:
GITEA_INSTANCE_URL: ${GITEA_INSTANCE_URL}
GITEA_RUNNER_REGISTRATION_TOKEN: ${GITEA_RUNNER_REGISTRATION_TOKEN}
GITEA_RUNNER_NAME: ${GITEA_RUNNER_NAME}
GITEA_RUNNER_LABELS: ""
# Point the runner at the DinD daemon.
DOCKER_HOST: tcp://dind:2375
CONFIG_FILE: /config.yaml
volumes:
- ./config.yaml:/config.yaml:ro
# Persist runner registration so it survives restarts.
- runner-data:/data
networks:
runner:
volumes:
dind-storage:
runner-data: