Docker: Docker for Windows
OS: Windows 10
As per the docker-compose.yml => mongo service uses the volume ./data mount to store data of mongo service.
For the very first time when you run/build your app, the mongo service + the api service runs fine.
For subsequent restart of the services, the mongo service exits as it faces a issue with windows file system and shows the error as "Operation is not permitted".
Description of the issue that I found: https://stackoverflow.com/a/39013930/8133717
Therefore one can change the ./data mount to docker's internal volume to mitigate the issue caused by data storage in windows file system.
Changes:
version: '3'
services:
api:
image: makinhs/rest-api-tutorial
#...
mongo:
image: mongo
volumes:
#mounting to docker's own volume system
- rest-api-tutorial-data:/data/db
networks:
- backend
ports:
- "27017:27017"
# adding the volumes needed at the end
volumes:
rest-api-tutorial-data: