networks:
  gitea:
    external: false
    name: gitea-net

services:
  server:
    image: docker.gitea.com/gitea
    container_name: gitea
    environment:
      - USER_UID=1000
      - USER_GID=1000
      - GITEA__database__DB_TYPE=postgres
      - GITEA__database__HOST=gitea-db:5432
      - GITEA__database__NAME=gitea
      - GITEA__database__USER=gitea
      - GITEA__database__PASSWD=gitea
      - GITEA__webhook__ALLOWED_HOST_LIST=*
    restart: unless-stopped
    networks:
      - gitea
    volumes:
      - /home/ccalifice/docker-data/gitea/gitea:/data
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "3005:3000"
      - "222:22"
    depends_on:
      - db

  db:
    image: docker.io/library/postgres:14
    container_name: gitea-db
    restart: unless-stopped
    environment:
      - POSTGRES_USER=gitea
      - POSTGRES_PASSWORD=gitea
      - POSTGRES_DB=gitea
    networks:
      - gitea
    volumes:
      - /home/ccalifice/docker-data/gitea/postgres:/var/lib/postgresql/data

  runner:
    image: docker.io/gitea/act_runner:latest
    container_name: gitea-runner
    environment:
      CONFIG_FILE: /config.yaml
      GITEA_INSTANCE_URL: "http://192.168.1.202:3005"
      GITEA_RUNNER_REGISTRATION_TOKEN: "q8X5Ja5wHK49yiFfHxJ4HEhCMKs8lKhYr771QHPh"
      GITEA_RUNNER_NAME: "services-runner"
      GITEA_RUNNER_LABELS: 
    volumes:
      - /home/ccalifice/docker-data/gitea/runner/config.yaml:/config.yaml
      - /home/ccalifice/docker-data/gitea/runner/data:/data
      - /var/run/docker.sock:/var/run/docker.sock
