I'm not deplyoing those files, deployer has to delete previous builds but since those files have been created under the root user, it fails at that step.
@sr57 I kinda inherited the project, but I see there is a supervisor running on the server. Although I don't exactly know how to test if it writes in the cache folder.
Thank you all so much for your help!
Sorry for the late reply.
Here is what I found out so far:
Docker creates a cron that runs schedule:run. That cron seems to have been created as the root user.
I changed that, so it is now created as www-data.
But what I see now is that the cron (although it says it's running) doesn't seem to actually create those cache files unless I manually got o the file and add an empty line at the end of it (there is one already). Delete it and just save the file again.
My crontab looks like this:
* * * * * /usr/local/bin/php -q -f /var/www/html/artisan schedule:run --no-ansi
#This is a comment to make sure the previous empty line is never stripped