Created
June 12, 2026 10:05
-
-
Save bartosz-maciaszek/518f24fb5c2c0de11a165489f37109c3 to your computer and use it in GitHub Desktop.
Mongo local replica set
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| services: | |
| mongo: | |
| image: mongo:7.0 | |
| container_name: mongo_replica | |
| hostname: mongo_replica | |
| command: ["--replSet", "rs0", "--bind_ip_all", "--port", "27017"] | |
| volumes: | |
| - dbdata:/data/db | |
| ports: | |
| - "27017:27017" | |
| restart: always | |
| healthcheck: | |
| test: echo "try { rs.status() } catch (err) { quit(1) }" | mongosh --port 27017 --quiet | |
| interval: 10s | |
| timeout: 5s | |
| retries: 5 | |
| volumes: | |
| dbdata: | |
| external: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment