65 lines
2.2 KiB
YAML
65 lines
2.2 KiB
YAML
name: gitea-gvisor
|
|
|
|
services:
|
|
gitea:
|
|
image: gitea/gitea:1.27.3
|
|
# The target Docker host may default to runsc. Gitea and the runner's
|
|
# privileged dockerd must stay on runc; only nested job sandboxes use runsc.
|
|
runtime: runc
|
|
restart: unless-stopped
|
|
environment:
|
|
USER_UID: "1000"
|
|
USER_GID: "1000"
|
|
GITEA__database__DB_TYPE: sqlite3
|
|
GITEA__security__INSTALL_LOCK: "true"
|
|
GITEA__actions__ENABLED: "true"
|
|
GITEA__server__DOMAIN: ${GITEA_DOMAIN:-gitea}
|
|
GITEA__server__SSH_DOMAIN: ${GITEA_DOMAIN:-gitea}
|
|
# Reachable from job containers, which share the runner's network
|
|
# namespace. Override with the public URL if the web UI must use it.
|
|
GITEA__server__ROOT_URL: ${GITEA_ROOT_URL:-http://gitea:3000/}
|
|
GITEA__server__HTTP_PORT: "3000"
|
|
volumes:
|
|
- gitea-data:/data
|
|
ports:
|
|
- "${GITEA_HTTP_PORT:-3000}:3000"
|
|
- "${GITEA_SSH_PORT:-2222}:22"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "curl -fsS http://localhost:3000/api/healthz || exit 1"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 60
|
|
start_period: 20s
|
|
|
|
runner:
|
|
build:
|
|
context: ./runner
|
|
image: gitea-gvisor-runner:latest
|
|
runtime: runc
|
|
restart: unless-stopped
|
|
# dockerd needs privileged mode to create the nested job containers. The job
|
|
# containers themselves always run under runsc/gVisor.
|
|
privileged: true
|
|
environment:
|
|
GITEA_INSTANCE_URL: http://gitea:3000
|
|
GITEA_RUNNER_NAME: ${GITEA_RUNNER_NAME:-gvisor-runner}
|
|
# Either set a token explicitly, or set GITEA_ADMIN_USER/PASSWORD and let
|
|
# the runner fetch one from the Gitea API.
|
|
GITEA_RUNNER_REGISTRATION_TOKEN: ${GITEA_RUNNER_REGISTRATION_TOKEN:-}
|
|
GITEA_ADMIN_USER: ${GITEA_ADMIN_USER:-}
|
|
GITEA_ADMIN_PASSWORD: ${GITEA_ADMIN_PASSWORD:-}
|
|
DOCKER_HOST: unix:///var/run/docker.sock
|
|
volumes:
|
|
- runner-data:/data
|
|
# Real disk-backed Docker storage: no memory-limited tmpfs, so arbitrary
|
|
# image and build sizes are possible.
|
|
- runner-docker:/var/lib/docker
|
|
depends_on:
|
|
gitea:
|
|
condition: service_healthy
|
|
|
|
volumes:
|
|
gitea-data:
|
|
runner-data:
|
|
runner-docker:
|