FROM python:3.11-slim # Install system dependencies RUN apt-get update && apt-get install -y \ ffmpeg \ wget \ curl \ git \ postgresql-client \ docker.io \ build-essential \ && rm -rf /var/lib/apt/lists/* # Set working directory WORKDIR /app # Install Python dependencies COPY requirements.txt . RUN pip install --no-cache-dir --upgrade pip && \ pip install --no-cache-dir -r requirements.txt # Copy application code COPY . . # Create directories RUN mkdir -p /downloads /plex # Expose port EXPOSE 8000 # Run migrations and start server CMD ["sh", "-c", "alembic upgrade head && uvicorn app.main:app --host 0.0.0.0 --port 8000"]