Skip to content

feat(templates): add mongodb replica set one-click template#8498

Closed
seeker71 wants to merge 2 commits intocoollabsio:nextfrom
seeker71:seeker71/mongodb-replicaset-bounty
Closed

feat(templates): add mongodb replica set one-click template#8498
seeker71 wants to merge 2 commits intocoollabsio:nextfrom
seeker71:seeker71/mongodb-replicaset-bounty

Conversation

@seeker71
Copy link
Copy Markdown

@seeker71 seeker71 commented Feb 20, 2026

Summary

  • Add a mongodb-replicaset one-click service template at templates/compose/mongodb-replicaset.yaml.
  • Deploys a 3-node MongoDB replica set (primary, secondary, arbiter) plus a one-shot init container.
  • Uses required env vars for root credentials and keyfile secret.
  • Includes idempotent replica-set initialization (rs.status() guard before rs.initiate).

Notes

  • Follows Coolify service-template conventions (metadata, compose-only template file, Coolify bind content for generated keyfile).
  • Uses $$ escaping in init shell command so runtime container env vars are not expanded by compose parsing.

Validation

  • YAML parsed successfully with Ruby YAML.safe_load.

Demo Video

Fixes #4778
/claim #4778

@algora-pbc algora-pbc bot added the 🙋 Bounty claim Issues or PRs that have a Bounty ready to be claimed. label Feb 20, 2026
@Cinzya
Copy link
Copy Markdown
Member

Cinzya commented Feb 21, 2026

It should be a feature in the Standalone databases, not as separate service.
For now, we could document this option as a workaround in the Coolify Docs.
Also again, friendly reminder to read our Contribution Guidelines. This is very important to us, especially with increasing AI PRs.

@tranducnus
Copy link
Copy Markdown

@Cinzya @peaklabs-dev
I understand the long-term goal of moving these to Standalone databases, but could we reconsider this as a service template for the time being?
There has been significant community demand for a MongoDB replica set for over a year, and similar database configurations (like PostgreSQL) are currently available as service templates. Providing this now would offer an immediate, verified solution for users while the Standalone database feature is being further developed.

@Cinzya
Copy link
Copy Markdown
Member

Cinzya commented Mar 1, 2026

@tranducnus It doesn't need to be an integrated service template for you to already be able to deploy this as a service.

If you select Docker Compose Empty as the resource type and paste the docker compose file that was provided in this PR, you get the same as if you would deploy one of the one click templates. Every one click template is essentially a pre-filled docker compose deployment.

We know not every user is aware of this behavior, hence why I recommended to @seeker71 to document this in the Coolify Docs for the time being.
image

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

🙋 Bounty claim Issues or PRs that have a Bounty ready to be claimed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants