# Use an official Python runtime as a parent image
FROM python:3.11-slim
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

# Set the working directory in the container
WORKDIR /code

# Install system dependencies
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
    postgresql-client \
    && rm -rf /var/lib/apt/lists/*

RUN uv pip install --system --no-cache-dir --upgrade quick_pp gunicorn

# Set the default command to run the backend
CMD ["quick_pp", "backend", "--no-open"]

# Expose the backend API port (application listens on 6312)
EXPOSE 6312