version: "3.8"

services:
  forgejo:
    image: codeberg.org/forgejo/forgejo:10
    container_name: forgejo
    restart: unless-stopped
    environment:
      - USER_UID=1000
      - USER_GID=1000
      - TZ=Europe/Helsinki
      - FORGEJO__SERVER__DOMAIN=git.halla-aho.net
      - FORGEJO__SERVER__ROOT_URL=https://git.halla-aho.net/
      - FORGEJO__SERVER__HTTP_PORT=3000
      - FORGEJO__SERVER__PROTOCOL=http
      - FORGEJO__SERVER__SSH_DOMAIN=git.halla-aho.net
      - FORGEJO__SERVER__SSH_PORT=2223
      - FORGEJO__DATABASE__DB_TYPE=sqlite3
      - FORGEJO__DATABASE__PATH=/data/forgejo.db
      - FORGEJO__MAILER__ENABLED=false
    volumes:
      - /srv/forgejo/data:/data
    ports:
      - "3200:3000" # HTTP (Apache will reverse proxy)
      - "2223:22"   # SSH for git

  runner:
    image: codeberg.org/forgejo/runner:4
    container_name: forgejo-runner
    restart: unless-stopped
    depends_on:
      - forgejo
    volumes:
      - /srv/forgejo/runner:/data
      - /var/run/docker.sock:/var/run/docker.sock
    command: ["forgejo-runner", "daemon", "--config", "/data/config.yaml"]
