mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-15 20:25:23 +02:00
Merge pull request #2332 from depado/fix-traefik-init-setup
fix(setup): properly handle dokploy-traefik container absence
This commit is contained in:
@@ -89,21 +89,14 @@ export const initializeStandaloneTraefik = async ({
|
||||
const docker = await getRemoteDocker(serverId);
|
||||
try {
|
||||
const container = docker.getContainer(containerName);
|
||||
try {
|
||||
await container.remove({ force: true });
|
||||
await new Promise((resolve) => setTimeout(resolve, 5000));
|
||||
await docker.createContainer(settings);
|
||||
const newContainer = docker.getContainer(containerName);
|
||||
await newContainer.start();
|
||||
console.log("Traefik Started ✅");
|
||||
} catch (error) {
|
||||
console.error("Error in initializeStandaloneTraefik", error);
|
||||
}
|
||||
} catch (error) {
|
||||
await docker.createContainer(settings);
|
||||
console.error("Error in initializeStandaloneTraefik", error);
|
||||
throw error;
|
||||
}
|
||||
await container.remove({ force: true });
|
||||
await new Promise((resolve) => setTimeout(resolve, 5000));
|
||||
} catch {}
|
||||
|
||||
await docker.createContainer(settings);
|
||||
const newContainer = docker.getContainer(containerName);
|
||||
await newContainer.start();
|
||||
console.log("Traefik Started ✅");
|
||||
};
|
||||
|
||||
export const initializeTraefikService = async ({
|
||||
|
||||
Reference in New Issue
Block a user