update dokcer compose files to remove mongo replica set config
This commit is contained in:
1 parent
f2e2d5c2ed
commit
096cfccf40
4 files changed
+16
-28
No files matched your search
@@ -35,11 +35,11 @@ services:
|
|||||||
mongodb:
|
mongodb:
|
||||||
image: uptime_mongo:latest
|
image: uptime_mongo:latest
|
||||||
restart: always
|
restart: always
|
||||||
command: ["mongod", "--quiet", "--replSet", "rs0", "--bind_ip_all"]
|
command: ["mongod", "--quiet", "--bind_ip_all"]
|
||||||
volumes:
|
volumes:
|
||||||
- ./mongo/data:/data/db
|
- ./mongo/data:/data/db
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: echo "try { rs.status() } catch (err) { rs.initiate({_id:'rs0',members:[{_id:0,host:'mongodb:27017'}]}) }" | mongosh --port 27017 --quiet
|
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')", "--quiet"]
|
||||||
interval: 5s
|
interval: 5s
|
||||||
timeout: 30s
|
timeout: 30s
|
||||||
start_period: 0s
|
start_period: 0s
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- UPTIME_APP_API_BASE_URL=http://localhost:52345/api/v1
|
- UPTIME_APP_API_BASE_URL=http://localhost:52345/api/v1
|
||||||
- UPTIME_APP_CLIENT_HOST=http://localhost
|
- UPTIME_APP_CLIENT_HOST=http://localhost
|
||||||
- DB_CONNECTION_STRING=mongodb://mongodb:27017/uptime_db?replicaSet=rs0
|
- DB_CONNECTION_STRING=mongodb://mongodb:27017/uptime_db
|
||||||
- REDIS_URL=redis://redis:6379
|
- REDIS_URL=redis://redis:6379
|
||||||
- CLIENT_HOST=http://localhost
|
- CLIENT_HOST=http://localhost
|
||||||
- JWT_SECRET=my_secret
|
- JWT_SECRET=my_secret
|
||||||
@@ -22,22 +22,10 @@ services:
|
|||||||
- "27017:27017"
|
- "27017:27017"
|
||||||
volumes:
|
volumes:
|
||||||
- ./mongo/data:/data/db
|
- ./mongo/data:/data/db
|
||||||
|
healthcheck:
|
||||||
mongo-init:
|
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')", "--quiet"]
|
||||||
image: mongo:4.4.18
|
interval: 5s
|
||||||
depends_on:
|
timeout: 30s
|
||||||
- mongodb
|
start_period: 0s
|
||||||
entrypoint: >
|
start_interval: 1s
|
||||||
bash -c "
|
retries: 30
|
||||||
echo 'Waiting for MongoDB to be ready...' &&
|
|
||||||
until mongo --host mongodb --eval 'db.adminCommand(\"ping\")' > /dev/null 2>&1; do
|
|
||||||
sleep 2
|
|
||||||
done &&
|
|
||||||
echo 'MongoDB is up. Initiating replica set...' &&
|
|
||||||
mongo --host mongodb --eval '
|
|
||||||
rs.initiate({
|
|
||||||
_id: \"rs0\",
|
|
||||||
members: [{ _id: 0, host: \"mongodb:27017\" }]
|
|
||||||
})
|
|
||||||
' || echo 'Replica set may already be initialized.'
|
|
||||||
"
|
|
||||||
@@ -7,7 +7,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- UPTIME_APP_API_BASE_URL=http://localhost:52345/api/v1
|
- UPTIME_APP_API_BASE_URL=http://localhost:52345/api/v1
|
||||||
- UPTIME_APP_CLIENT_HOST=http://localhost
|
- UPTIME_APP_CLIENT_HOST=http://localhost
|
||||||
- DB_CONNECTION_STRING=mongodb://mongodb:27017/uptime_db?replicaSet=rs0
|
- DB_CONNECTION_STRING=mongodb://mongodb:27017/uptime_db
|
||||||
- REDIS_URL=redis://redis:6379
|
- REDIS_URL=redis://redis:6379
|
||||||
- CLIENT_HOST=http://localhost
|
- CLIENT_HOST=http://localhost
|
||||||
- JWT_SECRET=my_secret
|
- JWT_SECRET=my_secret
|
||||||
@@ -16,11 +16,11 @@ services:
|
|||||||
mongodb:
|
mongodb:
|
||||||
image: ghcr.io/bluewave-labs/checkmate-mongo:latest
|
image: ghcr.io/bluewave-labs/checkmate-mongo:latest
|
||||||
restart: always
|
restart: always
|
||||||
command: ["mongod", "--quiet", "--replSet", "rs0", "--bind_ip_all"]
|
command: ["mongod", "--quiet", "--bind_ip_all"]
|
||||||
volumes:
|
volumes:
|
||||||
- ./mongo/data:/data/db
|
- ./mongo/data:/data/db
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: echo "try { rs.status() } catch (err) { rs.initiate({_id:'rs0',members:[{_id:0,host:'mongodb:27017'}]}) }" | mongosh --port 27017 --quiet
|
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')", "--quiet"]
|
||||||
interval: 5s
|
interval: 5s
|
||||||
timeout: 30s
|
timeout: 30s
|
||||||
start_period: 0s
|
start_period: 0s
|
||||||
|
|||||||
Vendored
+3
-3
@@ -18,7 +18,7 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- mongodb
|
- mongodb
|
||||||
environment:
|
environment:
|
||||||
- DB_CONNECTION_STRING=mongodb://mongodb:27017/uptime_db?replicaSet=rs0
|
- DB_CONNECTION_STRING=mongodb://mongodb:27017/uptime_db
|
||||||
- REDIS_URL=redis://redis:6379
|
- REDIS_URL=redis://redis:6379
|
||||||
- CLIENT_HOST=http://localhost
|
- CLIENT_HOST=http://localhost
|
||||||
- JWT_SECRET=my_secret
|
- JWT_SECRET=my_secret
|
||||||
@@ -29,9 +29,9 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- ./mongo/data:/data/db
|
- ./mongo/data:/data/db
|
||||||
command: ["mongod", "--quiet", "--replSet", "rs0", "--bind_ip_all"]
|
command: ["mongod", "--quiet", "--bind_ip_all"]
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: echo "try { rs.status() } catch (err) { rs.initiate({_id:'rs0',members:[{_id:0,host:'mongodb:27017'}]}) }" | mongosh --port 27017 --quiet
|
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')", "--quiet"]
|
||||||
interval: 5s
|
interval: 5s
|
||||||
timeout: 30s
|
timeout: 30s
|
||||||
start_period: 0s
|
start_period: 0s
|
||||||
|
|||||||
Reference in new issue
Block a user