Closed zhouhao27 closed 5 years ago
You are correct. A volume mount will override subfolders. Using ./storage:/var/www/html/storage
will replace all folders that exist in the container.
As you've found explicitly mapping subfolders is the only way around this.
You could extend the entrypoint script to do some filesystem magic, but I don't think that'd be ideal.
Here is my docker-compose.yml:
The page will be blank.
Then I change my docker-compose.yml to this:
It works then.
I noticed it's because the folder will be removed when the folder in host is mapped to a folder in container. Is there a way to keep the data in container? Thanks.