Repository navigation
Fix static assets 404 in Docker image - #15
Merged
CampingAvocado merged 1 commit intoOct 1, 2026
Merged
Conversation
The final image copies assets to /server/assets but the binary sits at image root (/mlm), so resolve_assets_dir()'s exe-relative fallback looks in /assets, and the compile-time CARGO_MANIFEST_DIR fallback points at a build-stage-only path. Neither exists at runtime, so ServeDir has no root and every /assets/* request 404s. Set MLM_ASSETS_DIR explicitly to the path assets are actually copied to. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
appstage of the Dockerfile copies assets to/server/assetsbut places the binary at the image root (/mlm).resolve_assets_dir()(server/src/web/mod.rs) falls back to a directory next to the executable (/assets) and, failing that, the compile-timeCARGO_MANIFEST_DIRpath baked in during the build stage (/app/server/assets) — neither exists in the final image, soServeDirgets a nonexistent root and every/assets/*request (style.css, elements.js, index.js, favicon, icons) 404s, leaving the UI completely unstyled.MLM_ASSETS_DIR=/server/assetsexplicitly in the Dockerfile, matching the actualCOPYdestination.Test plan
docker compose build), restarted the container, and confirmed the "Static assets directory does not exist" warning is gone from the logs and/assets/style.css,/assets/elements.js,/assets/index.jsall return200instead of404.🤖 Generated with Claude Code