service: forgejo
image: arndttouby/forgejo

servers:
  web:
    - 142.132.178.134

proxy:
  ssl: true
  host: git.touby.eu
  app_port: 3000
  healthcheck:
    path: /

registry:
  server: ghcr.io
  username: arndttouby
  password:
    - KAMAL_REGISTRY_PASSWORD

builder:
  arch: arm64
  context: .

env:
  clear:
    USER_UID: 1000
    USER_GID: 1000
    FORGEJO__database__DB_TYPE: postgres
    FORGEJO__database__HOST: forgejo-db
  secret:
    - FORGEJO__database__NAME
    - FORGEJO__database__USER
    - FORGEJO__database__PASSWD

volumes:
  - forgejo:/data
  - /etc/timezone:/etc/timezone:ro
  - /etc/localtime:/etc/localtime:ro

accessories:
  db:
    image: postgres:17
    host: 142.132.178.134
    port: 5432:5432
    env:
      secret:
        - POSTGRES_DB
        - POSTGRES_USER
        - POSTGRES_PASSWORD
    directories:
      - postgresql/data:/var/lib/postgresql/data
