1
0
Fork 0

update and fix some files

This commit is contained in:
Samive 2026-04-01 17:07:23 +08:00
commit 5828f03c5c
4 changed files with 316 additions and 13 deletions

View file

@ -1,19 +1,31 @@
FROM python:3.14-slim
FROM python:3.14.3-slim
# Install ffmpeg for merging video+audio streams
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg && rm -rf /var/lib/apt/lists/*
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
WORKDIR /app
# Install Python dependencies
RUN pip install --no-cache-dir yt-dlp fastapi "uvicorn[standard]" httpx
# System packages
RUN apt-get update \
&& apt-get install -y --no-install-recommends ffmpeg \
&& rm -rf /var/lib/apt/lists/*
# Copy web app
COPY web/backend ./web/backend
COPY web/frontend ./web/frontend
# Create non-root user
RUN adduser --disabled-password --gecos "" appuser \
&& chown -R appuser:appuser /app
RUN mkdir -p /app/web/backend/downloads
# Copy dependency file first for better build cache
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt
# Copy app
COPY web /app/web
RUN mkdir -p /app/web/backend/downloads \
&& chown -R appuser:appuser /app/web/backend/downloads
USER appuser
EXPOSE 8000
CMD ["python", "-m", "uvicorn", "web.backend.main:app", "--host", "0.0.0.0", "--port", "8000"]
CMD ["python", "-m", "uvicorn", "web.backend.main:app", "--host", "0.0.0.0", "--port", "8000"]