31 lines
860 B
Docker
31 lines
860 B
Docker
# Backend Dockerfile for FastAPI with Python 3.14
|
|
FROM python:3.14-slim AS dependencies
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
|
|
|
|
ENV VIRTUAL_ENV=/app/.venv
|
|
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
|
|
|
COPY backend/pyproject.toml backend/uv.lock* ./
|
|
# Hatchling resolves the readme path ../README.md relative to the backend
|
|
# package root (/app). Create a stub so metadata validation succeeds without
|
|
# requiring the file to pass through .dockerignore.
|
|
RUN echo '# plex-playlist' > /README.md
|
|
RUN uv venv "$VIRTUAL_ENV" && uv sync --frozen --no-dev
|
|
|
|
FROM python:3.14-slim AS runtime
|
|
|
|
WORKDIR /app
|
|
|
|
ENV VIRTUAL_ENV=/app/.venv
|
|
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
|
|
|
COPY --from=dependencies /app/.venv /app/.venv
|
|
COPY backend/src ./src
|
|
|
|
EXPOSE 8000
|
|
|
|
CMD ["uvicorn", "backend.main:app", "--app-dir", "/app/src", "--host", "0.0.0.0", "--port", "8000"]
|