alpine dockerfile
This commit is contained in:
11
Dockerfile
11
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
|
# Alpine's package manager (apk) doesn't pull in 300MB of useless dependencies
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apk add --no-cache ffmpeg
|
||||||
ffmpeg \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install deps first so Docker layer cache doesn't rebuild on code changes
|
|
||||||
COPY requirements.txt .
|
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
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
COPY main.py .
|
COPY main.py .
|
||||||
@@ -16,3 +14,4 @@ COPY main.py .
|
|||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
|
||||||
CMD ["python3", "main.py"]
|
CMD ["python3", "main.py"]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user