mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-13 18:05:31 +02:00
feat(setup): add async execution of docker pull for traefik image during setup
This commit is contained in:
@@ -124,26 +124,6 @@ export const initializeTraefik = async ({
|
||||
console.log("No existing container to remove");
|
||||
}
|
||||
|
||||
try {
|
||||
await docker.getImage(imageName).inspect();
|
||||
console.log(`Image ${imageName} already exists locally.`);
|
||||
} catch (error: any) {
|
||||
if (error?.statusCode === 404) {
|
||||
console.log(`Image ${imageName} not found, pulling...`);
|
||||
const stream = await docker.pull(imageName);
|
||||
await new Promise((resolve, reject) => {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
docker.modem.followProgress(stream, (err: Error, res: any) =>
|
||||
err ? reject(err) : resolve(res),
|
||||
);
|
||||
});
|
||||
console.log(`Image ${imageName} pulled successfully.`);
|
||||
} else {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
// Create and start the new container
|
||||
try {
|
||||
await docker.createContainer(settings);
|
||||
|
||||
Reference in New Issue
Block a user