How to backup docker-compose exec -T <mongodb_service_name> mongodump --archive --gzip --db <mongodb_database> > dump.gz How to restore docker-compose exec -T mongorestore --archive --gzip < dump.gz