services:
  postgres:
    image: postgres:16-alpine
    environment:
      POSTGRES_DB: ${KANEO_DB}
      POSTGRES_USER: ${KANEO_DB_USER}
      POSTGRES_PASSWORD: ${KANEO_DB_PASSWORD}
    volumes:
      - postgres_data:/var/lib/postgresql/data
    restart: unless-stopped

  backend:
    image: ghcr.io/usekaneo/api:latest
    environment:
      JWT_ACCESS: ${KANEO_JWT_ACCESS}
      DATABASE_URL: "postgresql://${KANEO_DB_USER}:${KANEO_DB_PASSWORD}@postgres:5432/${KANEO_DB}"
    ports:
      - 1337
    depends_on:
      postgres:
        condition: service_started
    restart: unless-stopped

  frontend:
    image: ghcr.io/usekaneo/web:latest
    environment:
      KANEO_API_URL: "http://${BACKEND_HOST}:1337"
    ports:
      - 5173
    depends_on:
      backend:
        condition: service_started
    restart: unless-stopped

volumes:
  postgres_data:
