Skip to content

Commit 6bb5404

Browse files
committed
fix(mongo): use appName instead of localhost for replica set
localhost doesn't work properly in containers
1 parent 72cc7a2 commit 6bb5404

File tree

1 file changed

+1
-1
lines changed
  • packages/server/src/utils/databases

1 file changed

+1
-1
lines changed

packages/server/src/utils/databases/mongo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ if [ "$REPLICA_STATUS" != "1" ]; then
5454
mongosh --eval '
5555
rs.initiate({
5656
_id: "rs0",
57-
members: [{ _id: 0, host: "localhost:27017", priority: 1 }]
57+
members: [{ _id: 0, host: "${appName}:27017", priority: 1 }]
5858
});
5959
6060
// Wait for the replica set to initialize

0 commit comments

Comments
 (0)