update Dockerfile
This commit is contained in:
parent
d4292beebb
commit
c5f5a7b74e
2 changed files with 22 additions and 5 deletions
18
Dockerfile
18
Dockerfile
|
|
@ -7,22 +7,30 @@ WORKDIR /app
|
|||
|
||||
# System packages
|
||||
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/*
|
||||
|
||||
# Create non-root user
|
||||
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 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 web /app/web
|
||||
|
||||
RUN mkdir -p /app/web/backend/downloads \
|
||||
&& chown -R appuser:appuser /app/web/backend/downloads
|
||||
RUN chown -R appuser:appuser /app/web/backend/downloads /home/appuser/.config/yt-dlp
|
||||
|
||||
USER appuser
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue