Skip to content

fix: ensure /data volume is writable by non-root appuser#32

Merged
sunba91-su merged 1 commit into
mainfrom
fix/db-permission
Jun 8, 2026
Merged

fix: ensure /data volume is writable by non-root appuser#32
sunba91-su merged 1 commit into
mainfrom
fix/db-permission

Conversation

@sunba91-su

Copy link
Copy Markdown
Owner

Problem

The bot container crashes on startup:

Failed to open database: ping db: sqlite3: unable to open database file: open /data/standup-bot.db: permission denied

The container runs as appuser (UID 1001) but /data in 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 /data in the Dockerfile before USER appuser, so the volume mount point is owned by the runtime user.

Verification

  • docker compose up --build no longer shows permission errors
  • Logs show: Database initialized at /data/standup-bot.db

Closes #31

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
@sunba91-su sunba91-su merged commit 3d52091 into main Jun 8, 2026
4 checks passed
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.

SQLite permission denied in Docker — /data volume owned by root

1 participant