services:
  forgejo:
    image: codeberg.org/forgejo/forgejo:9
    container_name: {{ forgejo_container_name }}
    restart: unless-stopped
    networks:
      - {{ docker_network }}
    volumes:
      - ./data:/data
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "127.0.0.1:{{ forgejo_port }}:3000"
      - "{{ forgejo_ssh_port }}:22"
    environment:
      - USER_UID=1000
      - USER_GID=1000
      - FORGEJO__server__ROOT_URL=https://{{ forgejo_domain }}
      - FORGEJO__server__SSH_DOMAIN={{ forgejo_domain }}
      - FORGEJO__server__SSH_PORT={{ forgejo_ssh_port }}
      - FORGEJO__actions__ENABLED=true

  runner:
    image: code.forgejo.org/forgejo/runner:6.2.2
    container_name: forgejo-runner
    command: forgejo-runner daemon
    restart: unless-stopped
    user: "0:0"
    networks:
      - {{ docker_network }}
    volumes:
      - ./runner:/data
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - DOCKER_HOST=unix:///var/run/docker.sock
    depends_on:
      - forgejo

networks:
  {{ docker_network }}:
    external: true
