FROM python:3.12-slim

WORKDIR /app

COPY web/_default_fastapi_htmx/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY web/_default_fastapi_htmx/app/ ./app/

EXPOSE 8000

# Healthcheck con `wget -qO-` — NO `--spider` (issue I-008)
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
  CMD wget -qO- http://localhost:8000/health || exit 1

CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
