mongodb preset runs the reviewed MongoDB 8.0 image on amd64 or arm64.
It listens on port 27017, stores data in /data/db, and authenticates against
the admin database for health checks and managed operations.
Declare the resource
.towbar/resources/mongodb.resource.yml
Create application-specific databases and users after MongoDB is ready. Keep
those credentials with the consuming app rather than reusing the root account.
Connect from an app
Containers on theapplication network can reach mongodb:27017. Include the
appropriate authentication database in the app’s secret connection string. The
optional tunnel binds 17017 only to server loopback for access over SSH.
Initialization and credential changes
The root initialization variables are used only for an empty/data/db volume.
Replacing them later does not rotate the MongoDB user. Change the credential in
MongoDB first, then update Towbar so its authenticated checks and operations
continue to work.
Back up and restore
Towbar produces a compressedmongodump archive and restores it with
mongorestore into a fresh target volume. Recovery requires MongoDB major
version 8. Continue with Database backups and Database restores.