mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-07 20:45:17 +00: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);
|
const docker = await getRemoteDocker(serverId);
|
||||||
try {
|
try {
|
||||||
const container = docker.getContainer(containerName);
|
const container = docker.getContainer(containerName);
|
||||||
try {
|
await container.remove({ force: true });
|
||||||
await container.remove({ force: true });
|
await new Promise((resolve) => setTimeout(resolve, 5000));
|
||||||
await new Promise((resolve) => setTimeout(resolve, 5000));
|
} catch {}
|
||||||
await docker.createContainer(settings);
|
|
||||||
const newContainer = docker.getContainer(containerName);
|
await docker.createContainer(settings);
|
||||||
await newContainer.start();
|
const newContainer = docker.getContainer(containerName);
|
||||||
console.log("Traefik Started ✅");
|
await newContainer.start();
|
||||||
} catch (error) {
|
console.log("Traefik Started ✅");
|
||||||
console.error("Error in initializeStandaloneTraefik", error);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
await docker.createContainer(settings);
|
|
||||||
console.error("Error in initializeStandaloneTraefik", error);
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const initializeTraefikService = async ({
|
export const initializeTraefikService = async ({
|
||||||
|
|||||||
Reference in New Issue
Block a user