fix: ensure /data volume is writable by non-root appuser#32
Merged
Conversation
The Dockerfile runs as non-root appuser (UID 1001) but /data in the image is owned by root. When a named volume mounts at /data, it inherits root ownership, causing 'permission denied' when SQLite tries to create standup-bot.db. Fix: add RUN mkdir -p /data && chown -R appuser:appuser /data before the USER appuser directive. Closes #31
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.
Problem
The bot container crashes on startup:
The container runs as
appuser(UID 1001) but/datain the image is owned by root. Docker named volumes inherit the ownership from the image's filesystem at the mount point.Fix
Added
RUN mkdir -p /data && chown -R appuser:appuser /datain the Dockerfile beforeUSER appuser, so the volume mount point is owned by the runtime user.Verification
docker compose up --buildno longer shows permission errorsDatabase initialized at /data/standup-bot.dbCloses #31