mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #735] [MERGED] fix(docker-lite): keep sharp installed in deps stage #4755
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#4755
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/735
Author: @Romuromylus
Created: 5/12/2026
Status: ✅ Merged
Merged: 5/12/2026
Merged by: @Romuromylus
Base:
main← Head:fix/sharp-required-not-optional📝 Commits (1)
d6b35acfix(docker-lite): keep sharp installed in deps stage📊 Changes
3 files changed (+18 additions, -7 deletions)
View changed files
📝
Dockerfile.lite(+12 -2)📝
packages/server/package.json(+2 -2)📝
pnpm-lock.yaml(+4 -3)📄 Description
Linked issue
Closes #734
Why this change
Dockerfile.liteproduces an image that crashes immediately on startup withERR_MODULE_NOT_FOUND: Cannot find package 'sharp' imported from /app/packages/server/dist/routes/game-assets.routes.js.packages/server/package.json'soptionalDependencies, butpackages/server/src/routes/game-assets.routes.tsuses a staticimport sharp from "sharp"at module load. The Lite deps stage installs with--no-optional, drops sharp, and the static import kills the process before the server can serve a request.What changed
packages/server/package.json: movedsharpfromoptionalDependenciestodependencies. Sharp is genuinely required (game-assets routes, sprite generation, background removal). Onlyonnxruntime-nodeandonnxruntime-webremain inoptionalDependencies— those are the truly-optional Lite-mode skippables.Dockerfile.litedeps stage: cannot keep--no-optionalbecause sharp's native binary ships through transitive optional packages (@img/sharp-linux-x64), which pnpm--no-optionaldrops alongside the genuinely-optional onnxruntime packages. New flow:pnpm install --frozen-lockfile --prod --ignore-scripts(no--no-optional)pnpm rebuild sharpto register the native binding that--ignore-scriptsskipped at install timerm -rfonnxruntime-node/onnxruntime-webfrom the.pnpmstore and the per-workspace symlinks, so the Lite image stays smallpnpm-lock.yaml: regenerated to reflect sharp's new section underpackages/server'sdependencies. No other changes.The regular
Dockerfilealready installs withpnpm install --frozen-lockfile --prod(no--no-optional), so the package-manifest move is backward-compatible there — no change in behavior for the full image.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Build + smoke test performed on a fresh amd64 Linux host (Ubuntu 5.15, Docker 28.4):
Observed:
runningstate, exit code 0, no restarts.GET http://127.0.0.1:17860/returns HTTP 200 (no startup crash — sharp's static import resolves successfully).sharp v0.34.5 / libvips v8.17.3loads cleanly, and a 10×10 PNG roundtrip viasharp({create:...}).png().toBuffer()succeeds (proves the native binding is registered, not just discoverable on disk).onnxruntime-nodeandonnxruntime-webare absent from both/app/node_modules/.pnpmand/app/packages/server/node_modules(pruning works).Still needs human verification:
Dockerfilestill builds and runs unchanged (the package-manifest move is intended to be a no-op there, but worth confirming).Docs and release impact
UI evidence (if applicable)
N/A — Docker build + server startup fix, no UI surface affected.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.