OK, this can be a rather technical subject, but give this video a chance without worrying too much about the details. Hopefully it conveys the concepts, because for me, it certainly slotted a few missing pieces together and the light started to shine. I was not clear on why and how volumes worked, and this cleared it up for me (to create persistent data to survive the container being recreated).
With Docker, you can, in theory, create a web application ready for use with just one or two commands. It is easy to update an application by re-pulling the latest image, or even move your apps and data to another server. This channel also has an excellent video unpacking how the docker-compose file actually works.
Using the command line is often the most precise way of doing this, but there are also graphical UI’s like Portainer that will achieve the same container creation and management.
I’m using this, and a few other videos, to prepare to migrate my whole web hosting away from legacy installs, to all being docker containers on a different hosting platform. This will also make it easier to move again in the future if I need to.
See
Docker explained simply
by The Digital Life on YouTube