FROM python:3.12-slim

WORKDIR /app

RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*

COPY pyproject.toml ./
COPY src/ ./src/
COPY config/ ./config/
COPY scripts/ ./scripts/
RUN pip install --no-cache-dir .
ENV PYTHONPATH=/app/src

RUN useradd -m appuser
# Keeping as root to be able to access /var/run/docker.sock cleanly, unless specifically configured with groups.
# USER appuser

CMD ["python", "src/health_agent/main.py"]
