Stop a Docker container and remove its volumes
Sometimes I want to restart from the ground up a database launched in a Docker container and to remove its data entirely.
I found that docker compose down
command has an option to do so:
bash
docker-compose down <container name> --volumes
That way, the volumes attached to <container name>
will be removed as well as the container.