fixed
This commit is contained in:
parent
be71cc40d1
commit
e047b35f77
@ -79,7 +79,7 @@ func connectToMongo() (*mongo.Client, error) {
|
||||
}
|
||||
|
||||
var result bson.M
|
||||
if err = client.Database("Test").RunCommand(context.TODO(), bson.D{{Key: "ping", Value: 1}}).Decode(&result); err != nil {
|
||||
if err = client.Database("admin").RunCommand(context.TODO(), bson.D{{Key: "ping", Value: 1}}).Decode(&result); err != nil {
|
||||
log.Println("Error ping:", err)
|
||||
return nil, err
|
||||
}
|
||||
|
@ -51,9 +51,8 @@ services:
|
||||
ports:
|
||||
- "27017:27017"
|
||||
environment:
|
||||
MONGO_INITDB_DATABASE: logs
|
||||
MONGO_INITDB_USERNAME: admin
|
||||
MONGO_INITDB_PASSWORD: password
|
||||
MONGO_INITDB_ROOT_USERNAME: admin
|
||||
MONGO_INITDB_ROOT_PASSWORD: password
|
||||
volumes:
|
||||
- ./db-data/mongo:/data/db
|
||||
|
||||
@ -71,5 +70,5 @@ services:
|
||||
environment:
|
||||
ME_CONFIG_MONGODB_ADMINUSERNAME: admin
|
||||
ME_CONFIG_MONGODB_ADMINPASSWORD: password
|
||||
ME_CONFIG_MONGODB_URL: mongodb://mongo:27017/
|
||||
ME_CONFIG_MONGODB_URL: mongodb://admin:password@mongo:27017/
|
||||
ME_CONFIG_BASICAUTH: false
|
||||
|
Loading…
Reference in New Issue
Block a user