Voici mon fichier .yml
version: '3.7'
services:
node1:
image: mongo
ports:
- 30001:27017
volumes:
- $HOME/mongoclusterdata/node1:/data/db
networks:
- mongocluster
command: mongod --replSet comments
node2:
image: mongo
ports:
- 30002:27017
volumes:
- $HOME/mongoclusterdata/node2:/data/db
networks:
- mongocluster
command: mongod --replSet comments
depends_on :
- node1
node3:
image: mongo
ports:
- 30003:27017
volumes:
- $HOME/mongoclusterdata/node3:/data/db
networks:
- mongocluster
command: mongod --replSet comments
depends_on :
- node2
networks:
mongocluster:
driver: bridge
La section de volume a un chemin absolu qui est différent de la racine. supprimer sur docker-installer haut/bas.