docker: alpine, autodownload

This commit is contained in:
imagede
2026-03-29 21:17:10 +02:00
parent 25bf7db167
commit 414750bfd8
4 changed files with 34 additions and 57 deletions

View File

@@ -1,9 +1,7 @@
FROM python:3.12-slim
FROM python:3.12-alpine
# Install ffmpeg (required for merging video+audio streams and MP3 conversion)
RUN apt-get update && \
apt-get install -y --no-install-recommends ffmpeg && \
rm -rf /var/lib/apt/lists/*
# Install ffmpeg and dcron (lightweight cron daemon for Alpine)
RUN apk add --no-cache ffmpeg dcron
WORKDIR /app
@@ -17,10 +15,10 @@ COPY app/ .
# Downloads are stored here (mount a host volume to persist them)
RUN mkdir -p /downloads
# Setup Cronjob
RUN apt-get update && apt-get install -y cron && \
echo "0 4 * * * pip install --upgrade yt-dlp >> /var/log/yt-dlp-upgrade.log 2>&1" | crontab -
# Setup Cronjob (fails)
RUN echo "0 4 * * * pip install --upgrade yt-dlp >> /var/log/yt-dlp-upgrade.log 2>&1" | crontab -
EXPOSE 8080
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080"]
# Launch
CMD uvicorn main:app --host 0.0.0.0 --port 8080