12 February 2025
Docker, IaCDocker Compose is a declarative tool that allows you to create YAML scripts to deploy Docker containers in a standardised fashion.
You may choose how the containers store persistent files on the host, so that when they are stopped, the data is not destroyed.
There are 3 options…
/var/www/html/var/lib/docker/volumes/**UUID**/_data, where UUID is a random ID/var/lib/docker/volumes directorywebroot is the name of your volume and /var/www/html is the target path in the containerservices:
nginx:
...
volumes:
- webroot:/var/www/html
volumes:
webroot:
/home/rob/webroot:/var/www/html/home/rob/webroot and the the target path in the container would be /var/www/html