services:
  # Database: Postgres with pgvector
  db:
    image: pgvector/pgvector:pg16
    container_name: seasoned-db
    restart: always
    environment:
      - POSTGRES_USER=${DB_USER}
      - POSTGRES_PASSWORD=${DB_PASSWORD}
      - POSTGRES_DB=${DB_NAME}
    ports:
      - "5432:5432"
    volumes:
      - pgdata:/var/lib/postgresql/data
      - ./init-db:/docker-entrypoint-initdb.d

  # Seasoned App: C# .NET 9 + Nuxt 4
  app:
    image: git.wrigglyt.xyz/chloe/seasoned:latest
    build: .
    container_name: seasoned-main
    restart: always
    env_file: .env
    ports:
      - "5000:5000"
    environment:
      - GEMINI_API_KEY=${GEMINI_API_KEY}
      - NUXT_PUBLIC_API_BASE=${NUXT_PUBLIC_API_BASE}
      - Jwt__Key=${JWT_KEY}
      - Jwt__Issuer=${JWT_ISSUER}
      - Jwt__Audience=${JWT_AUDIENCE}
      - ConnectionStrings__DefaultConnection=${ConnectionStrings__DefaultConnection}
      - ASPNETCORE_ENVIRONMENT=Production
      - ASPNETCORE_HTTP_PORTS=8080
    depends_on:
      - db

volumes:
  pgdata: