24 lines
616 B
YAML
24 lines
616 B
YAML
networks:
|
|
mongodb-network:
|
|
name: "mongodb-network"
|
|
driver: bridge
|
|
services:
|
|
mongodb:
|
|
image: "mongo:7.0"
|
|
container_name: "habitica-mongodb-only"
|
|
networks:
|
|
- mongodb-network
|
|
hostname: "mongodb"
|
|
ports:
|
|
- "27017:27017"
|
|
restart: "unless-stopped"
|
|
volumes:
|
|
- "./mongodb-data-docker:/data/db"
|
|
entrypoint: [ "/usr/bin/mongod", "--bind_ip_all", "--replSet", "rs" ]
|
|
healthcheck:
|
|
test: echo "try { rs.status() } catch (err) { rs.initiate() }" | mongosh --port 27017 --quiet
|
|
interval: 10s
|
|
timeout: 30s
|
|
start_period: 0s
|
|
retries: 30
|
|
|