large update
This commit is contained in:
@@ -4,11 +4,11 @@
|
||||
FROM python:3.14-slim AS builder
|
||||
WORKDIR /app
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
#RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
# build-essential \
|
||||
# ca-certificates \
|
||||
# && rm -rf /var/lib/apt/lists/*
|
||||
#
|
||||
COPY requirements.txt ./
|
||||
# Build wheels into /wheels (use cache for pip downloads)
|
||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||
@@ -19,18 +19,32 @@ RUN --mount=type=cache,target=/root/.cache/pip \
|
||||
FROM python:3.14-slim AS final
|
||||
WORKDIR /app
|
||||
|
||||
# minimal runtime deps
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
ca-certificates \
|
||||
aria2 \
|
||||
ffmpeg \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
## minimal runtime deps (use static ffmpeg to avoid many apt deps)
|
||||
#RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
# ca-certificates \
|
||||
# curl \
|
||||
# && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy wheels from builder and install
|
||||
COPY --from=builder /wheels /wheels
|
||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||
pip install --no-cache-dir /wheels/* || pip install --no-cache-dir /wheels/* --no-deps
|
||||
|
||||
# Download a static ffmpeg build (faster than installing via apt and avoids many deps)
|
||||
RUN set -eux; \
|
||||
arch="$(dpkg --print-architecture)"; \
|
||||
if [ "$arch" = "amd64" ]; then \
|
||||
FFMPEG_URL="https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz"; \
|
||||
else \
|
||||
echo "Unsupported arch $arch"; exit 1; \
|
||||
fi; \
|
||||
curl -fsSL "$FFMPEG_URL" -o /tmp/ffmpeg.tar.xz; \
|
||||
tar -xJf /tmp/ffmpeg.tar.xz -C /tmp; \
|
||||
cp /tmp/ffmpeg-*-amd64-static/ffmpeg /usr/local/bin/; \
|
||||
cp /tmp/ffmpeg-*-amd64-static/ffprobe /usr/local/bin/; \
|
||||
chmod +x /usr/local/bin/ffmpeg /usr/local/bin/ffprobe; \
|
||||
rm -rf /tmp/ffmpeg*
|
||||
|
||||
# Copy application code (exclude models/data via .dockerignore)
|
||||
COPY . ./api
|
||||
|
||||
|
||||
Reference in New Issue
Block a user