Last active
August 18, 2025 22:00
-
-
Save badnetmask/521cc3558b881fa312535d2975681e4f to your computer and use it in GitHub Desktop.
Supporting material my blog post: https://mteixeira.wordpress.com/2025/02/02/my-self-hosted-forgejo-runner-setup/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: "3" | |
| services: | |
| caddy: | |
| image: lucaslorentz/caddy-docker-proxy:ci-alpine | |
| ports: | |
| - 80:80 | |
| - 443:443 | |
| labels: | |
| caddy: (stepca) | |
| caddy.tls: [REDACTED email] | |
| caddy.tls.ca: https://step.[REDACTED zone]:9000/acme/acme/directory | |
| caddy.tls.ca_root: /data/caddy/pki/homelab-ca.crt | |
| volumes: | |
| - ./caddy_data:/data | |
| - /var/run/docker.sock:/var/run/docker.sock | |
| - /usr/local/share/ca-certificates/homelab-ca.crt:/data/caddy/pki/homelab-ca.crt | |
| restart: unless-stopped | |
| forgejo: | |
| container_name: forgejo | |
| image: codeberg.org/forgejo/forgejo:9 | |
| labels: | |
| caddy: forgejo.[REDACTED zone] | |
| caddy.import: stepca | |
| caddy.reverse_proxy: "{{ upstreams 3000 }}" | |
| ports: | |
| - '2222:22' | |
| environment: | |
| - USER_UID=1000 | |
| - USER_GID=1000 | |
| - FORGEJO__server__DOMAIN=forgejo.[REDACTED zone] | |
| - FORGEJO__server__SSH_DOMAIN=forgejo.[REDACTED zone] | |
| - FORGEJO__server__ROOT_URL=https://forgejo.[REDACTED zone] | |
| - FORGEJO__server__DISABLE_SSH=false | |
| - FORGEJO__server__SSH_PORT=2222 | |
| - FORGEJO__server__SSH_LISTEN_PORT=22 | |
| volumes: | |
| - ./forgejo:/data | |
| - /etc/timezone:/etc/timezone:ro | |
| - /etc/localtime:/etc/localtime:ro | |
| restart: unless-stopped | |
| docker-in-docker: | |
| image: code.forgejo.org/oci/docker:dind | |
| container_name: docker-in-docker | |
| hostname: docker | |
| privileged: true | |
| environment: | |
| DOCKER_TLS_CERTDIR: /data/certs | |
| volumes: | |
| - ./forgejo-runner:/data | |
| - /etc/ssl/certs/ca-certificates.crt:/etc/pki/tls/certs/ca-bundle.crt:ro | |
| - /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt:ro | |
| - /usr/local/share/ca-certificates/homelab-ca.crt:/usr/local/share/ca-certificates/homelab-ca.crt:ro | |
| restart: 'unless-stopped' | |
| forgejo-runner: | |
| image: data.forgejo.org/forgejo/runner:6 | |
| links: | |
| - docker-in-docker | |
| depends_on: | |
| docker-in-docker: | |
| condition: service_started | |
| container_name: forgejo-runner | |
| environment: | |
| DOCKER_HOST: tcp://docker:2376 | |
| DOCKER_CERT_PATH: /data/certs/client | |
| DOCKER_TLS_VERIFY: "1" | |
| user: 1000:1000 | |
| volumes: | |
| - ./forgejo-runner:/data | |
| - /etc/ssl/certs/ca-certificates.crt:/etc/pki/tls/certs/ca-bundle.crt:ro | |
| - /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt:ro | |
| - /usr/local/share/ca-certificates/homelab-ca.crt:/usr/local/share/ca-certificates/homelab-ca.crt:ro | |
| command: '/bin/sh -c "sleep 5; forgejo-runner daemon --config /data/config.yaml"' | |
| restart: 'unless-stopped' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment