fix: Resolve Docker permission issues in development environment

- Create dedicated Dockerfile.backend.dev for development with proper permissions
- Set user UID/GID to 1000 (common for development systems)
- Create logs and temp directories in Dockerfile before switching user
- Use named volumes for logs, temp, and node_modules to maintain permissions
- Mount only source files instead of entire backend directory
- Remove complex entrypoint script in favor of simple CMD
- Add LOG_DIR and TEMP_DIR environment variables

This fixes the "Permission denied" errors when creating directories in Docker.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-07-23 14:32:14 +02:00
parent d99a299bf5
commit 7bcee648ad
4 changed files with 61 additions and 24 deletions
+1 -11
View File
@@ -1,15 +1,5 @@
#!/bin/sh
set -e
# Ensure logs directory exists with correct permissions
if [ ! -d "/app/logs" ]; then
mkdir -p /app/logs
fi
# Ensure temp directory exists
if [ ! -d "/app/temp" ]; then
mkdir -p /app/temp
fi
# Start the application
exec node src/app.js
exec "$@"