29 lines
966 B
Docker
29 lines
966 B
Docker
FROM debian:bullseye-slim AS builder
|
|
|
|
# Install ffmpeg and mkvtoolnix
|
|
# but only keep the binaries and libs for ffprobe and mkvmerge
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
ffmpeg mkvtoolnix \
|
|
&& mkdir -p /artifacts/bin /artifacts/lib \
|
|
&& cp $(which ffprobe) /artifacts/bin/ \
|
|
&& cp $(which mkvmerge) /artifacts/bin/ \
|
|
&& ldd $(which ffprobe) | awk '{print $3}' | xargs -I '{}' cp -v '{}' /artifacts/lib/ || true \
|
|
&& ldd $(which mkvmerge) | awk '{print $3}' | xargs -I '{}' cp -v '{}' /artifacts/lib/ || true
|
|
|
|
# Must be the same base as builder image for shared libraries compatibility
|
|
FROM python:3.13.3-slim-bullseye
|
|
|
|
COPY --from=builder /artifacts/bin/* /usr/local/bin/
|
|
COPY --from=builder /artifacts/lib/* /usr/local/lib/
|
|
ENV LD_LIBRARY_PATH=/usr/local/lib
|
|
|
|
WORKDIR /app
|
|
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY . .
|
|
|
|
EXPOSE 8000
|
|
|
|
CMD ["python", "-m", "scripts.server"] |