From 013b022427d274d4b61ed0d6bef9cefe59ccb375 Mon Sep 17 00:00:00 2001 From: Michele Adduci Date: Mon, 16 Dec 2024 13:08:15 +0100 Subject: [PATCH 1/2] Added Docker Image for using markitdown in a sandboxed environment --- .dockerignore | 1 + Dockerfile | 12 ++++++++++++ README.md | 7 +++++++ 3 files changed, 20 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..f59ec20 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +* \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3dd6100 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM python:3.13-alpine + +USER root + +# Runtime dependency +RUN apk add --no-cache ffmpeg + +RUN pip install markitdown + +USER 10000:10000 + +ENTRYPOINT [ "markitdown" ] diff --git a/README.md b/README.md index df7189d..50b5a80 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,13 @@ result = md.convert("example.jpg") print(result.text_content) ``` +You can also use the project as Docker Image: + +```sh +docker build -t markitdown:latest . +docker run --rm -i markitdown:latest < ~/your-file.pdf > output.md +``` + ## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a From 5fc03b64152ca9021b537e57a845701d5506a10e Mon Sep 17 00:00:00 2001 From: Michele Adduci Date: Mon, 16 Dec 2024 13:11:13 +0100 Subject: [PATCH 2/2] Added UID as argument --- Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3dd6100..492ad8a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,10 @@ RUN apk add --no-cache ffmpeg RUN pip install markitdown -USER 10000:10000 +# Default USERID and GROUPID +ARG USERID=10000 +ARG GROUPID=10000 + +USER $USERID:$GROUPID ENTRYPOINT [ "markitdown" ]