I want to create a Docker image that starts a mongo server and automatically restores from a previous mongodump on startup.
mongodump
Here is my Dockerfile for
A similar solution to RyanNHG's, but without an sh file.
Dockerfile
FROM mongo:3.6.8 COPY dump/ /tmp/dump/ CMD mongod --fork --logpath /var/log/mongodb.log; \ mongorestore /tmp/dump/; \ mongod --shutdown; \ docker-entrypoint.sh mongod