services:
  postgres:
    image: postgres:17
    restart: unless-stopped
    environment:
      POSTGRES_USER: rpg
      POSTGRES_PASSWORD: rpg
      POSTGRES_DB: rpg_summariser
    volumes:
      - pgdata:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U rpg -d rpg_summariser"]
      interval: 5s
      timeout: 5s
      retries: 5

  bot:
    image: ghcr.io/zackpollard/discord-rpg-summariser:latest
    restart: unless-stopped
    depends_on:
      postgres:
        condition: service_healthy
    ports:
      - "8080:8080"
    volumes:
      - ./config.yaml:/app/config.yaml:ro
      - audio:/app/data/audio
      - models:/app/models
    environment:
      DATABASE_URL: postgres://rpg:rpg@postgres:5432/rpg_summariser?sslmode=disable

volumes:
  pgdata:
  audio:
  models:
