mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-28 04:25:08 +02:00
perf(cli): cache the Node install layer across source-only changes
The generated Node Dockerfile copies source before running the install, so the first source change invalidates the install layer and every dependency is reinstalled. A production build showed 0/3 steps cached with `npm ci` rebuilding at 16.9s. Copy `package.json` and the lockfile first instead. Falls back to the current output when there is no lockfile, when an install lifecycle hook is present, when a custom install command is set, or when the config is nested in a workspace.
This commit is contained in:
@@ -1019,7 +1019,7 @@ def python_config_to_docker_uv_lock(
|
||||
docker_plan.add_instruction("WORKDIR", plan.working_dir)
|
||||
docker_plan.add_instruction(
|
||||
"RUN",
|
||||
f"{_get_node_pm_install_cmd(plan.target_root)} && "
|
||||
f"{_get_node_pm_install_cmd(plan.target_root)[0]} && "
|
||||
"tsx /api/langgraph_api/js/build.mts",
|
||||
)
|
||||
docker_plan.add_raw("# -- End of JS dependencies install --")
|
||||
|
||||
Reference in New Issue
Block a user