When working with a Docker container, data can be persistent or not. Imagine you're creating a localhost website with Joomla, Wordpress or any other tool (Laravel, Symfony, etc.).
You've perfectly created the various Docker files needed to run the local site, you've run the command
docker compose up --detach to start the containers and now you're busy installing the site. After a few moments, your local site is up and you can start developing its functionalities.
By default, if you haven't taken any precautions, the moment you stop the container (
docker compose down), you'll kill your site, i.e. by default, having not taken care to save your data (your site, your database), everything will be lost and reset the next time you run
docker compose up --detach. Well... Maybe that was your wish (something totally ephemeral); maybe not;