Hi.Events
Hi.Events copied to clipboard
[Backend Docker] Logs permissions issue and manual migration required
Hi ! I am experiencing two issues with the current backend Docker image that need to be addressed:
-
File Permissions Issue
- The
storage/logs/laravel.logfile is owned byrootand not writable by the Laravel application user - This causes logging to fail during container operation
- The backend is not usable if the lavarel.log is not owned by www-data (Error 500)
- The application should have proper write permissions to all necessary storage directories
- The
-
Missing Artisan Automation
- Artisan commands (like migrations) are not automatically run on first startup
- This requires manual intervention during deployment and updates
- Automatic execution when a version change is detected would ensure database schema is always up-to-date
Expected Behavior:
- All necessary files/directories in
storage/should be writable by the Laravel application user - Artisan commands (migrations, etc.) should run automatically on first container startup
- The container should be fully functional without requiring manual intervention after deployment
Hey @ajussak. Are you using a pre-build docker image or have you built your own? There is a chance that a publicly available docker image is slightly out of date and you might be best to compile your own for the time being.
Hey ! Yes, i use the public Docker image. I found some workarounds :
- Adding a script to /etc/entrypoint.d/ to do a chown on /var/www/html/storage/logs
- According to ServerSide Up documentation, i use AUTORUN_ENABLED=true to apply artisan tasks at startup
- Also according to ServerSide Up documentation, i run another container with same image which executes the command
php /var/www/html/artisan queue:work --queue=default,webhook-queue --sleep=3 --tries=3 --timeout=60
The solution was to read the manual of the image base 😅