version: "3.9"
services:
  db:
    image: postgres
    container_name: Gitea-DB
    hostname: gitea-db
    security_opt:
      - no-new-privileges:true
    healthcheck:
      test: ["CMD", "pg_isready", "-q", "-d", "gitea", "-U", "osmf15Ox8vsF9jqW"]
      timeout: 45s
      interval: 10s
      retries: 10
    user: 0:0
    volumes:
      - ./db:/var/lib/postgresql/data:rw
    environment:
      - POSTGRES_DB=gitea
      - POSTGRES_USER=osmf15Ox8vsF9jqW
      - POSTGRES_PASSWORD=6PLjxG0mXGAfNrK4rUT7wrlzQJ9r4IOq
    restart: on-failure:5

  web:
    image: gitea/gitea:latest
    container_name: Gitea
    hostname: gitea
    security_opt:
      - no-new-privileges:true
    healthcheck:
      test: wget --no-verbose --tries=1 --spider http://localhost:3000/ || exit 1
    ports:
      - 3052:3000
      - '2222:22'
    volumes:
      - ./data:/data
      - /etc/TZ:/etc/TZ:ro
      - /etc/localtime:/etc/localtime:ro
    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=osmf15Ox8vsF9jqW
      - GITEA__database__PASSWD=6PLjxG0mXGAfNrK4rUT7wrlzQJ9r4IOq
      - ROOT_URL=https://git.{{domaine_ext}}
    restart: on-failure:5
    depends_on:
    - db
  runner:
    image: gitea/act_runner:nightly
    environment:
      CONFIG_FILE: /config.yaml
      GITEA_INSTANCE_URL: "https://git.{{domaine_ext}}"
      GITEA_RUNNER_REGISTRATION_TOKEN: "2D0IxOHijNQVrMhKav8nGNpyJlF8qia51fy1Lwch"
      GITEA_RUNNER_NAME: "runner_prod"
      GITEA_RUNNER_LABELS: "runner_prod"
    volumes:
      - ./runner/config.yaml:/config.yaml
      #- /home/ubuntu/redm/txData/RexshackRedMBuild_000214.base:/data/redm
      - ./runner/data:/data
      - /var/run/docker.sock:/var/run/docker.sock