From b5e7ae0e33376453ec89cbfb65756c2ecffd2dc8 Mon Sep 17 00:00:00 2001 From: Thomas Meckel Date: Wed, 10 Sep 2025 20:28:27 +0000 Subject: [PATCH] feat: add Python runtime to support MCP servers like Microsoft MarkItDown Fixes #1 --- Dockerfile | 13 +++++++++++++ Makefile | 7 ++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 53955b0..935cebe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,6 +29,19 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ zip \ && rm -rf /var/lib/apt/lists/* +# Install Python 3.11 and pip in a dedicated layer +# hadolint ignore=DL3008 +RUN apt-get update && apt-get install -y --no-install-recommends \ + python3.11 \ + python3.11-venv \ + python3.11-distutils \ + python3-pip \ + ffmpeg \ + && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 || true \ + && ln -sf /usr/bin/pip3 /usr/bin/pip || true \ + && ln -sf /usr/bin/python3.11 /usr/bin/python || true \ + && rm -rf /var/lib/apt/lists/* + RUN npm install -g "@openai/codex@${CODEX_CLI_VERSION}" USER ${USERNAME} diff --git a/Makefile b/Makefile index 1ba4bc3..26422d8 100644 --- a/Makefile +++ b/Makefile @@ -5,11 +5,16 @@ TAG ?= dev IMAGE_REF := $(IMAGE):$(TAG) DOCKERFILE ?= Dockerfile CONTEXT ?= . +CODEX_CLI_VERSION ?= latest .PHONY: build clean build: - docker build -t $(IMAGE_REF) -f $(DOCKERFILE) $(CONTEXT) + docker build \ + -t $(IMAGE_REF) \ + -f $(DOCKERFILE) \ + --build-arg CODEX_CLI_VERSION=$(CODEX_CLI_VERSION) \ + $(CONTEXT) clean: @echo "Removing image $(IMAGE_REF) if it exists..."