I am trying to configure docker-compose with Node and MongoDB. In combination with the official Mongo container, I use a dedicated container ( mongodb-backup ) for continuous backup of the database and initial restore to start.
My problem is how to call the backup in case of a graceful shutdown of docker-compose stop .
Therefore, you must first close the Node container to ensure that the process does not write to the database. Then back up the database and finally close the mongodb and mongodb containers backups.
This repository contains my layout configuration of the mongodb and mongodb docker file.
Does anyone have an idea how to implement this?
source share