Files
plex-playlist/Dockerfile.backend
copilotcoder 98058475cb
Some checks failed
CICD Start / Sanity and Base Decision (pull_request) Successful in 15s
CICD Start / Sanity and Base Decision (push) Failing after 14m56s
fix(backend): set uvicorn app-dir for src layout runtime
2026-07-04 09:15:23 -04:00

38 lines
1.0 KiB
Docker

# Backend Dockerfile for FastAPI with Python 3.14
FROM python:3.14-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
# Create and activate virtual environment
ENV VIRTUAL_ENV=/app/.venv
RUN uv venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# Copy dependency files first for better caching
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
# Install runtime dependencies only
RUN uv sync --frozen --no-dev
# Copy application code
COPY backend/ .
# Expose port
EXPOSE 8000
# Default command - can be overridden in compose for development
CMD ["uvicorn", "backend.main:app", "--app-dir", "/app/src", "--host", "0.0.0.0", "--port", "8000"]