I have a PHP app in docker that has an empty logs folder, that I added to the docker container as a volume:
app:
volumes:
- ./app/logs:/var/log/app
But when the app tries to write it raises an error because it has no permission.
I need a way to set permissions for it everytime the container gets created, so no manual process is needed, I also need the logs to persist even when the container is destroyed.
How can I do it? What would be a good practice for this scenario?