FROM python:3.12-slim

WORKDIR /app

RUN apt-get update && apt-get install -y --no-install-recommends \
    libgl1 libglib2.0-0 libsm6 libxrender1 libxext6 \
    && rm -rf /var/lib/apt/lists/*

COPY pyproject.toml README.md ./
COPY muleline/ muleline/
COPY example.py .
COPY splash/ splash/

RUN pip install --no-cache-dir ".[server]" python-multipart PyJWT Pillow numpy

ENV MULELINE_DATA_DIR=/app/data
EXPOSE 8510

CMD ["uvicorn", "example:app", "--host", "0.0.0.0", "--port", "8510"]
