To replace the volumes_from: directive from version 2 (for helpyio), I tried this, but something went wrong.
version: "3"
services:
frontend:
...
volumes:
- myVolume:/var/www:ro
backend:
...
volumes:
- myVolume:/var/www
volumes:
myVolume:
driver: local
driver_opts:
type: none
device: "/my/local/absolute/path/"
o: bind
I have errors like
ERROR: for frontend: Cannot create container for service frontend: failed to mount local volume: mount /my/local/absolute/path/:/var/www, flags: 0x1000: no such file or directory
I also tried some variant in volumes: options but without success. And last thing, I don't want to create manually this local directory.
I am sure to miss something, but can't see what... Has anyone a solution for this use case?
Many thanks
There's no reason to make your docker-compose.yml that complicated. You can simply do this:
version: "3"
services:
frontend:
...
volumes:
- /my/local/absolute/path/:/var/www:ro
backend:
...
volumes:
- /my/local/absolute/path/:/var/www
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With