- MongoDB image running in ECS on EC2 t2.small
- Task has a volume added that is "shared" and should thus survive the recreation its container
- tasks container has the volume mounted on /data
- Insert a document
- (force) redeploy the task
- MongoDB has the document after the containers recreation
- MongoDB has no Documents and is launched "clean"
- Mount your volume at /data/db
- also mount a second volume at /data/configdb to keep your configuration (e.g. replication) persistent
- The base docker image alreade defines two volumes at /data/configdb and /data/db
- These volumes have no persistence defined and are being deleted on container shutdown
- if you mount your volume at /data that leaves the default defined volumes untouched no matter what you define in your volume