Skip to content

Dockerfile: fix permissions Binds entry shadowing /app#6

Open
KevinGriffin-new wants to merge 1 commit into
BlueOS-community:mainfrom
KevinGriffin-new:fix-binds-shadowing-app
Open

Dockerfile: fix permissions Binds entry shadowing /app#6
KevinGriffin-new wants to merge 1 commit into
BlueOS-community:mainfrom
KevinGriffin-new:fix-binds-shadowing-app

Conversation

@KevinGriffin-new

Copy link
Copy Markdown

Fixes #5.

What

  • The permissions label no longer bind-mounts over /app. It binds /usr/blueos/extensions/quickstart/logs:/app/logs instead, so log persistence survives without shadowing the application code. (A literal path is used because Docker never substitutes $IMAGE_NAME inside single-quoted LABEL values — see Binds permission mounts an empty directory over /app, crash-looping the extension on install #5.)
  • WORKDIR /app + litestar --app main:app run make app discovery explicit instead of relying on the container's default working directory.
  • The static files directory is resolved relative to main.py (Path(__file__).parent / 'static') instead of the working directory, which the WORKDIR change 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, and litestar run finds 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):

  • container stays up (previously crash-looped with the old bind applied)
  • GET / serves the frontend (HTTP 200)
  • GET /temp_count returns {"value": 1}
  • lumber.log appears in the bound host directory

🤖 Generated with Claude Code

* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Binds permission mounts an empty directory over /app, crash-looping the extension on install

1 participant