I have this docker-compose:
version: "2" services: api: build: . ports: - "3007:3007" links: - mongo mongo: image: mongo volumes: - /data/mongodb/db:/data/db ports: - "27017:27017"
Volumes /data/mongodb/db:/data/db is the first part ( /data/mongodb/db ) where the data is stored inside the image, and the second part ( /data/db ) where it is stored locally?
It works in production (ubuntu), but when I run it on my dev machine (mac), I get:
ERROR: for mongo Cannot start service mongo: error while creating mount source path '/data/mongodb/db': mkdir /data/mongodb: permission denied
Even if I run it as sudo. I added the /data directory in the File Sharing section of the Mac docker.

Is the idea to use the same docker composition for both production and development? How to solve this problem?
source share