SELinux might be preventing the writes by the container. If it is enabled, you need to make sure the folders are labeled with container_file_t. On the command line you can achieve it by adding :Z to your volume: podman run -d -v ./data:/app/data:Z --name mycontainer myimage. I guess it should work with compose as well. On the volume definition you can try something like this:
volumes:
- ./data:/app/data:Z