1
0
Fork 0

update Dockerfile

This commit is contained in:
Samive 2026-04-10 15:30:04 +08:00
commit c5f5a7b74e
2 changed files with 22 additions and 5 deletions

View file

@ -7,22 +7,30 @@ WORKDIR /app
# System packages # System packages
RUN apt-get update \ RUN apt-get update \
&& apt-get install -y --no-install-recommends ffmpeg \ && apt-get install -y --no-install-recommends \
ffmpeg \
nodejs \
npm \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Create non-root user # Create non-root user
RUN adduser --disabled-password --gecos "" appuser \ RUN adduser --disabled-password --gecos "" appuser \
&& chown -R appuser:appuser /app && mkdir -p /app/web/backend/downloads \
&& mkdir -p /home/appuser/.config/yt-dlp \
&& chown -R appuser:appuser /app /home/appuser
# Copy dependency file first for better build cache # Copy dependency file first for better build cache
COPY requirements.txt /app/requirements.txt COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt RUN pip install --no-cache-dir -r /app/requirements.txt \
&& pip install --no-cache-dir -U "yt-dlp[default]"
# Copy yt-dlp config
COPY yt-dlp.conf /home/appuser/.config/yt-dlp/config
# Copy app # Copy app
COPY web /app/web COPY web /app/web
RUN mkdir -p /app/web/backend/downloads \ RUN chown -R appuser:appuser /app/web/backend/downloads /home/appuser/.config/yt-dlp
&& chown -R appuser:appuser /app/web/backend/downloads
USER appuser USER appuser

9
docker-compose.yml Normal file
View file

@ -0,0 +1,9 @@
services:
yt-dlp-web:
build: .
container_name: yt-dlp-web
ports:
- "8000:8000"
volumes:
- ./cookies.txt:/tmp/cookies.txt:ro
- ./downloads:/app/web/backend/downloads