Skip to content

fix: resolve SQLITE_CANTOPEN with Docker volume permissions - #48

Merged
VishnuByrraju merged 1 commit into
mainfrom
fix-sqlite-permissions
Apr 14, 2026
Merged

fix: resolve SQLITE_CANTOPEN with Docker volume permissions#48
VishnuByrraju merged 1 commit into
mainfrom
fix-sqlite-permissions

Conversation

@VishnuByrraju

Copy link
Copy Markdown
Member

Problem

When running Atom in Docker with a host-mounted volume for /app/data, the SQLite database fails with SQLITE_CANTOPEN because the non-root nextjs user (uid 1001) cannot write to the root-owned mounted directory.

Root Cause

The Dockerfile switches to a non-root user before starting the app, but host-mounted volumes are typically owned by root. The nextjs user lacks write permissions to create or modify the SQLite database files.

Solution

  • Added docker-entrypoint.sh that runs as root on startup, fixes ownership of /app/data to nextjs:nodejs, then drops privileges via su-exec before starting the Node.js server
  • Installed su-exec in the Docker image for secure privilege dropping
  • Added .gitattributes to ensure shell scripts maintain LF line endings across platforms

Changes

  • Dockerfile: Added su-exec package, entrypoint script copy, replaced USER/CMD with ENTRYPOINT
  • docker-entrypoint.sh: New entrypoint handling volume permissions
  • .gitattributes: Enforce LF endings for .sh files

@VishnuByrraju
VishnuByrraju merged commit ff4bd9f into main Apr 14, 2026
1 check passed
@VishnuByrraju
VishnuByrraju deleted the fix-sqlite-permissions branch April 14, 2026 14:55
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.

1 participant