Skip to content

chore(docker): install only the serving deps into the MCP image - #116

Merged
Irahan2 merged 3 commits into
mainfrom
chore/98-docker-image-hygiene
Sep 29, 2026
Merged

Irahan2 merged 3 commits into
mainfrom
chore/98-docker-image-hygiene

Conversation

@Irahan2

@Irahan2 Irahan2 commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

The MCP image was installing the whole lockfile, Prefect and PyMuPDF included. The pipeline libraries are now a pipeline dependency group and ruff/datamodel-code-generator are dev, so Dockerfile.mcp syncs with --no-default-groups and Dockerfile.prefect adds --group pipeline. A plain uv sync still installs everything, so local and CI don't change. langchain had to stay in the main deps since langfuse.langchain imports it. Locally the MCP image went from 1.19 GB to 797 MB and the new one passes /health against a fresh Neo4j. Also pinned fastmcp <3 and added a .dockerignore

Fixes #98

Prefect, PyMuPDF, pytesseract, python-docx, bs4, Pillow and langchain-community move to a
`pipeline` dependency group, and ruff and datamodel-code-generator to `dev`. Dockerfile.mcp
syncs with --no-default-groups, Dockerfile.prefect adds --group pipeline, and default-groups
keeps a plain `uv sync` installing everything for local work and CI.

langchain stays in [project]: nothing in src/mcp_server imports it, but
langfuse.langchain.CallbackHandler refuses to load without it.

fastmcp is pinned below 3, as its startup banner asks. No locked version changes.

Locally the MCP image goes from 1.19 GB to 797 MB, the Prefect image from 1.32 GB to 1.26 GB.

Refs #98
Keeps .venv, .env, .history/ (editor snapshots of .env), dumps/, staging/ and host
__pycache__ out of the build context. The Dockerfiles COPY named paths only, so none of
this reached an image, but the legacy builder sent 1.04 GB to the daemon on every build
(now 1.5 MB), and the host's .pyc files under src/ were copied into the MCP image.

Refs #98
@Irahan2
Irahan2 requested review from Dominik-Galus, jgilewicz and omakszewska and removed request for jgilewicz and omakszewska September 28, 2026 06:54

@Dominik-Galus Dominik-Galus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Irahan2
Irahan2 added this pull request to the merge queue Sep 29, 2026
Merged via the queue into main with commit 762e02f Sep 29, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docker build and image hygiene

2 participants