Hi.Events icon indicating copy to clipboard operation
Hi.Events copied to clipboard

[Backend Docker] Logs permissions issue and manual migration required

Open ajussak opened this issue 6 months ago • 2 comments

Hi ! I am experiencing two issues with the current backend Docker image that need to be addressed:

  1. File Permissions Issue

    • The storage/logs/laravel.log file is owned by root and 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
  2. 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:

  1. All necessary files/directories in storage/ should be writable by the Laravel application user
  2. Artisan commands (migrations, etc.) should run automatically on first container startup
  3. The container should be fully functional without requiring manual intervention after deployment

ajussak avatar Aug 01 '25 21:08 ajussak

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.

creativeindustriesgroup avatar Aug 10 '25 00:08 creativeindustriesgroup

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 😅

ajussak avatar Aug 12 '25 08:08 ajussak