FROM python:3.12-slim

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

WORKDIR /app
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

COPY cauldron /app/cauldron

EXPOSE 7790

CMD ["gunicorn", "cauldron.server:app", \
     "-b", "0.0.0.0:7790", \
     "--workers", "2", \
     "--timeout", "180", \
     "--access-logfile", "-"]
