mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-18 20:35:24 +02:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
24729f35ec | ||
|
|
3eaeaa1db4 | ||
|
|
de4a00f1e9 | ||
|
|
2f5cd620c5 |
@@ -97,11 +97,7 @@ export const ShowTraefikActions = ({ serverId }: Props) => {
|
|||||||
);
|
);
|
||||||
refetchDashboard();
|
refetchDashboard();
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {});
|
||||||
toast.error(
|
|
||||||
`${haveTraefikDashboardPortEnabled ? "Disabled" : "Enabled"} Dashboard`,
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}}
|
}}
|
||||||
className="w-full cursor-pointer space-x-3"
|
className="w-full cursor-pointer space-x-3"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "dokploy",
|
"name": "dokploy",
|
||||||
"version": "v0.25.0",
|
"version": "v0.25.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
@@ -342,6 +342,8 @@ export const readPorts = async (
|
|||||||
command = `docker service inspect ${resourceName} --format '{{json .Spec.EndpointSpec.Ports}}'`;
|
command = `docker service inspect ${resourceName} --format '{{json .Spec.EndpointSpec.Ports}}'`;
|
||||||
} else if (resourceType === "standalone") {
|
} else if (resourceType === "standalone") {
|
||||||
command = `docker container inspect ${resourceName} --format '{{json .NetworkSettings.Ports}}'`;
|
command = `docker container inspect ${resourceName} --format '{{json .NetworkSettings.Ports}}'`;
|
||||||
|
} else {
|
||||||
|
throw new Error("Resource type not found");
|
||||||
}
|
}
|
||||||
let result = "";
|
let result = "";
|
||||||
if (serverId) {
|
if (serverId) {
|
||||||
@@ -397,17 +399,20 @@ export const writeTraefikSetup = async (input: TraefikOptions) => {
|
|||||||
"dokploy-traefik",
|
"dokploy-traefik",
|
||||||
input.serverId,
|
input.serverId,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (resourceType === "service") {
|
if (resourceType === "service") {
|
||||||
await initializeTraefikService({
|
await initializeTraefikService({
|
||||||
env: input.env,
|
env: input.env,
|
||||||
additionalPorts: input.additionalPorts,
|
additionalPorts: input.additionalPorts,
|
||||||
serverId: input.serverId,
|
serverId: input.serverId,
|
||||||
});
|
});
|
||||||
} else {
|
} else if (resourceType === "standalone") {
|
||||||
await initializeStandaloneTraefik({
|
await initializeStandaloneTraefik({
|
||||||
env: input.env,
|
env: input.env,
|
||||||
additionalPorts: input.additionalPorts,
|
additionalPorts: input.additionalPorts,
|
||||||
serverId: input.serverId,
|
serverId: input.serverId,
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
throw new Error("Traefik resource type not found");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -87,16 +87,27 @@ export const initializeStandaloneTraefik = async ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const docker = await getRemoteDocker(serverId);
|
const docker = await getRemoteDocker(serverId);
|
||||||
|
try {
|
||||||
|
await docker.pull(imageName);
|
||||||
|
await new Promise((resolve) => setTimeout(resolve, 3000));
|
||||||
|
console.log("Traefik Image Pulled ✅");
|
||||||
|
} catch (error) {
|
||||||
|
console.log("Traefik Image Not Found: Pulling ", error);
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
const container = docker.getContainer(containerName);
|
const container = docker.getContainer(containerName);
|
||||||
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 {}
|
} catch {}
|
||||||
|
|
||||||
await docker.createContainer(settings);
|
try {
|
||||||
const newContainer = docker.getContainer(containerName);
|
await docker.createContainer(settings);
|
||||||
await newContainer.start();
|
const newContainer = docker.getContainer(containerName);
|
||||||
console.log("Traefik Started ✅");
|
await newContainer.start();
|
||||||
|
console.log("Traefik Started ✅");
|
||||||
|
} catch (error) {
|
||||||
|
console.log("Traefik Not Found: Starting ", error);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const initializeTraefikService = async ({
|
export const initializeTraefikService = async ({
|
||||||
|
|||||||
Reference in New Issue
Block a user