mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
Enhance backup functionality by adding support for compose backups in various components. Update ShowBackups to clarify backup update requirements, modify initCronJobs to include compose backups, and improve logging for backup scheduling. Additionally, ensure that the scheduleBackup function retains the latest backups for compose types and document the addition of domains and backups in the Docker compose process.
This commit is contained in:
parent
19bf4f27b6
commit
77d7dc1f22
@ -161,7 +161,7 @@ export const ShowBackups = ({
|
|||||||
{backupType === "compose" && (
|
{backupType === "compose" && (
|
||||||
<AlertBlock type="info">
|
<AlertBlock type="info">
|
||||||
Deploy is required to apply changes after creating or
|
Deploy is required to apply changes after creating or
|
||||||
updating a backup.
|
updating the service name in the backup.
|
||||||
</AlertBlock>
|
</AlertBlock>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
@ -70,6 +70,7 @@ export const initCronJobs = async () => {
|
|||||||
mysql: true,
|
mysql: true,
|
||||||
mongo: true,
|
mongo: true,
|
||||||
user: true,
|
user: true,
|
||||||
|
compose: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -77,10 +78,10 @@ export const initCronJobs = async () => {
|
|||||||
try {
|
try {
|
||||||
if (backup.enabled) {
|
if (backup.enabled) {
|
||||||
scheduleBackup(backup);
|
scheduleBackup(backup);
|
||||||
|
console.log(
|
||||||
|
`[Backup] ${backup.databaseType} Enabled with cron: [${backup.schedule}]`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
console.log(
|
|
||||||
`[Backup] ${backup.databaseType} Enabled with cron: [${backup.schedule}]`,
|
|
||||||
);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`[Backup] ${backup.databaseType} Error`, error);
|
console.error(`[Backup] ${backup.databaseType} Error`, error);
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,7 @@ export const scheduleBackup = (backup: BackupSchedule) => {
|
|||||||
}
|
}
|
||||||
} else if (backup.backupType === "compose" && compose) {
|
} else if (backup.backupType === "compose" && compose) {
|
||||||
await runComposeBackup(compose, backup);
|
await runComposeBackup(compose, backup);
|
||||||
|
await keepLatestNBackups(backup, compose.serverId);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -210,6 +210,7 @@ export const addDomainToCompose = async (
|
|||||||
result = randomized;
|
result = randomized;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add domains to the compose
|
||||||
for (const domain of domains) {
|
for (const domain of domains) {
|
||||||
const { serviceName, https } = domain;
|
const { serviceName, https } = domain;
|
||||||
if (!serviceName) {
|
if (!serviceName) {
|
||||||
@ -264,6 +265,7 @@ export const addDomainToCompose = async (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add backups to the compose
|
||||||
for (const backup of backups) {
|
for (const backup of backups) {
|
||||||
const { backupId, serviceName, enabled } = backup;
|
const { backupId, serviceName, enabled } = backup;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user