FROM python:3.11-slim

ARG APP_VERSION=0.1.0
ARG APP_BUILD_INFO=dev

ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    APP_VERSION=${APP_VERSION} \
    APP_BUILD_INFO=${APP_BUILD_INFO}

WORKDIR /app/backend

COPY backend/pyproject.toml ./pyproject.toml
COPY backend/src ./src
COPY backend/tests ./tests

RUN pip install --no-cache-dir --upgrade pip \
    && pip install --no-cache-dir .

EXPOSE 8000

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