Dockerfile: fix permissions Binds entry shadowing /app#6
Open
KevinGriffin-new wants to merge 1 commit into
Open
Dockerfile: fix permissions Binds entry shadowing /app#6KevinGriffin-new wants to merge 1 commit into
KevinGriffin-new wants to merge 1 commit into
Conversation
* Bind only the logs directory instead of mounting over /app: Docker
creates the host dir empty on first install, hiding the application
code and crash-looping the extension ('Could not find a Litestar app
or factory'). $IMAGE_NAME was also never substituted, since Docker
does not expand variables in single-quoted LABEL values.
* Set WORKDIR /app and pass --app main:app so app discovery no longer
depends on the container's default working directory.
* Resolve the static files directory relative to main.py instead of
the working directory.
Fixes BlueOS-community#5
Co-Authored-By: Claude Fable 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.
Fixes #5.
What
permissionslabel no longer bind-mounts over/app. It binds/usr/blueos/extensions/quickstart/logs:/app/logsinstead, so log persistence survives without shadowing the application code. (A literal path is used because Docker never substitutes$IMAGE_NAMEinside single-quotedLABELvalues — see Binds permission mounts an empty directory over /app, crash-looping the extension on install #5.)WORKDIR /app+litestar --app main:app runmake app discovery explicit instead of relying on the container's default working directory.main.py(Path(__file__).parent / 'static') instead of the working directory, which theWORKDIRchange would otherwise have broken.Why
Installing the published image through Kraken crash-loops: Docker creates the (empty) host directory named literally
$IMAGE_NAME, mounts it over/app, andlitestar runfinds no app ("Could not find a Litestar app or factory"). Full analysis and reproduction in #5.Verification
Built this branch and ran it with the new bind (
-v <empty-host-dir>:/app/logs):GET /serves the frontend (HTTP 200)GET /temp_countreturns{"value": 1}lumber.logappears in the bound host directory🤖 Generated with Claude Code