diff --git a/Dockerfile b/Dockerfile index 98b7fb7..17b0a1d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,12 @@ -FROM python:3.12-slim +FROM python:3.12-alpine -# ffmpeg is non-negotiable — yt-dlp will silently fail without it -RUN apt-get update && apt-get install -y --no-install-recommends \ - ffmpeg \ - && rm -rf /var/lib/apt/lists/* +# Alpine's package manager (apk) doesn't pull in 300MB of useless dependencies +RUN apk add --no-cache ffmpeg WORKDIR /app -# Install deps first so Docker layer cache doesn't rebuild on code changes COPY requirements.txt . +# --no-cache-dir is mandatory or pip leaves a bunch of trash behind RUN pip install --no-cache-dir -r requirements.txt COPY main.py . @@ -16,3 +14,4 @@ COPY main.py . EXPOSE 8000 CMD ["python3", "main.py"] +