I set up the symfony-docker configuration in a sulu application. Everything works fine in development thanks to the bind mount of the app root directory. But in production, the media files uploaded by the user are not persisted when containers are restarted.
I tried adding a volume like that, in docker-compose.yml
(in the php
service or in the caddy
service):
services:
php:
volumes:
- uploads:/srv/app/public/uploads
...
volumes:
uploads:
But then, the thumbnails are not generated when I upload an image. And, when using the image in a template, I get the following error when the media is fetched:
Failed to create "/srv/app/public/uploads/media/homepage-1920x/04": mkdir(): Permission denied