I am trying to connect docker compose with my local mongodb , everything works fine and connection is working but my db is empty inside the container , i cant see my old data , however my local database is full . i am using windows for now for testing , this is how my docker looks like
version: "3"
services:
api:
container_name : docker-node-mongo
build: .
ports:
- "3500:3001"
- "5858:5858"
links:
- mongo
mongo:
container_name : mongo
image: mongo
volumes:
- c:/data/db:/data/db
ports:
- '27017:27017'
i understand that the trick is with volumes: for my mongo . - data:/data/db , ./data/db:/data/db , $HOME/data/db , nothing works.
please help