From be91526c90f085d7687f476cdf5ca1dc912fb263 Mon Sep 17 00:00:00 2001 From: LordBaryhobal Date: Sun, 4 May 2025 00:35:54 +0200 Subject: [PATCH] feat: add ffprobe and mkvmerge to docker image + requirements --- Dockerfile | 26 ++++++++++++++++++++++++-- requirements.txt | 1 + 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 requirements.txt diff --git a/Dockerfile b/Dockerfile index 973f914..df1defb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,29 @@ -FROM python:3.13.3-alpine +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 . . -CMD ["python3.13", "src/server.py"] \ No newline at end of file +EXPOSE 8000 + +CMD ["python", "src/server.py"] \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..c6c52fb --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +watchdog==6.0.0