fix: backups should be done with internal db url

fix: create default database on mongodb start with a collection
This commit is contained in:
Andras Bacsai
2023-10-24 09:34:35 +02:00
parent b539f40fa5
commit 91acd4cb6a
7 changed files with 34 additions and 11 deletions

View File

@@ -170,7 +170,7 @@ class DatabaseBackupJob implements ShouldQueue, ShouldBeEncrypted
private function backup_standalone_mongodb(string $databaseWithCollections): void
{
try {
$url = $this->database->getDbUrl();
$url = $this->database->getDbUrl(useInternal: true);
if ($databaseWithCollections === 'all') {
$commands[] = "mkdir -p " . $this->backup_dir;
$commands[] = "docker exec $this->container_name mongodump --authenticationDatabase=admin --uri=$url --gzip --archive > $this->backup_location";