update and fix some files
This commit is contained in:
parent
c39c3501c8
commit
5828f03c5c
4 changed files with 316 additions and 13 deletions
32
Dockerfile
32
Dockerfile
|
|
@ -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"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue