mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
Fix Docker volume permissions for SQLite database
- Add runtime permission fix in docker-entrypoint.sh to ensure /app/data volume has correct ownership before app starts - Remove build-time chown for /app/data from Dockerfile since Docker volumes are mounted at runtime, not build time - This resolves SQLITE_READONLY error when upgrading to OpenCode 1.4.0 The database volume may have incorrect ownership when mounted by Docker, causing the SQLite database to be read-only. The entrypoint script now fixes permissions before starting the backend (runs as root before USER node).
This commit is contained in:
1 parent
9973e00dc5
commit
2831533777
2 files changed
+12
-2
No files matched your search
+3
-2
@@ -93,8 +93,9 @@ RUN mkdir -p /app/backend/node_modules/@opencode-manager && \
|
||||
COPY scripts/docker-entrypoint.sh /docker-entrypoint.sh
|
||||
RUN chmod +x /docker-entrypoint.sh
|
||||
|
||||
RUN mkdir -p /workspace /app/data && \
|
||||
chown -R node:node /workspace /app/data
|
||||
RUN mkdir -p /workspace && \
|
||||
chown -R node:node /workspace
|
||||
# Note: /app/data is a Docker volume, permissions are handled at runtime in entrypoint
|
||||
|
||||
EXPOSE 5003 5100 5101 5102 5103
|
||||
|
||||
|
||||
@@ -75,5 +75,14 @@ if [ -z "$AUTH_SECRET" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Fix database directory permissions for Docker volumes
|
||||
# Docker volumes are mounted at runtime and may have incorrect ownership
|
||||
if [ -d "/app/data" ]; then
|
||||
echo "🔧 Ensuring database directory permissions..."
|
||||
chown -R node:node /app/data 2>/dev/null || true
|
||||
chmod -R 755 /app/data 2>/dev/null || true
|
||||
echo "✅ Database directory permissions set"
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
|
||||
Reference in new issue
Block a user