diff --git a/DOKPLOY.md b/DOKPLOY.md index d62e3f3..4b958db 100644 --- a/DOKPLOY.md +++ b/DOKPLOY.md @@ -250,6 +250,14 @@ If you see error: `FileNotFoundError: [Errno 2] No such file or directory: '/var **Solution**: This is already fixed in the latest version. The production settings now use console logging only, which is Docker-friendly and works with Dokploy's log viewing system. +### **Static Files Permission Error** +If you see error: `PermissionError: [Errno 13] Permission denied: '/app/staticfiles/js'` + +**Solution**: This is fixed in the latest version by: +- Creating static directories with proper permissions in Dockerfile +- Ensuring directories exist before collecting static files in entrypoint.sh +- Using proper Docker user permissions for file operations + ### **Domain Not Accessible** ```bash # Check DNS propagation diff --git a/Dockerfile b/Dockerfile index 14acd6f..7a6adbd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,7 +39,10 @@ RUN groupadd -r django && useradd -r -g django django COPY . /app/ -RUN chown -R django:django /app +# Create directories that need write permissions +RUN mkdir -p /app/staticfiles /app/media && \ + chown -R django:django /app + USER django EXPOSE 8000 diff --git a/entrypoint.sh b/entrypoint.sh index 12c75b7..a58ed26 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -15,6 +15,8 @@ echo "Setting up social applications..." python manage.py setup_social_apps echo "Collecting static files..." +# Ensure static directories exist with proper permissions +mkdir -p /app/staticfiles /app/media python manage.py collectstatic --noinput exec "$@" \ No newline at end of file