services: forgejo_runner: image: code.forgejo.org/forgejo/runner:12.5.2 container_name: ${CONTAINER_NAME:-forgejo-runner} restart: always user: root command: "/data/scripts/register.sh" volumes: - ./data:/data - ./scripts/register.sh:/data/scripts/register.sh:ro - /var/run/docker.sock:/var/run/docker.sock # 使用宿主机 Docker environment: - DOCKER_HOST=unix:///var/run/docker.sock # 指定宿主机 socket - FORGEJO_INSTANCE_URL=${FORGEJO_INSTANCE_URL} - RUNNER_REGISTRATION_TOKEN=${RUNNER_REGISTRATION_TOKEN} - RUNNER_NAME=${RUNNER_NAME} - RUNNER_LABELS=${RUNNER_LABELS} networks: - 1panel-network labels: createdBy: "Apps" networks: 1panel-network: external: true