I am trying to run mongodb using docker-compose.
Every time I restart the containers, I see that mongo creates default volumes with random names and the number of volume grows.
Why these volumes are created and how can I avoid them.
My docker-compose.yml for mongo is as follows:
mongo:
image: mongo
restart: always
networks:
- ts-net
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: root
volumes:
- db_data:/data/db/
