docker: alpine, autodownload
This commit is contained in:
16
Dockerfile
16
Dockerfile
@@ -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
|
||||
Reference in New Issue
Block a user