Merge pull request #2527 from Dokploy/fix/connect-network-after-creation-remote-servers

Fix/connect network after creation remote servers
This commit is contained in:
Mauricio Siu
2025-09-05 01:52:54 -06:00
committed by GitHub
2 changed files with 8 additions and 3 deletions

View File

@@ -277,6 +277,7 @@ export const getDockerResourceType = async (
const { stdout } = await execAsync(command);
result = stdout.trim();
}
console.log("result", result);
if (result === "service") {
return "service";
}
@@ -291,11 +292,14 @@ export const reloadDockerResource = async (
serverId?: string,
) => {
const resourceType = await getDockerResourceType(resourceName, serverId);
console.log("resourceType", resourceType);
let command = "";
if (resourceType === "service") {
command = `docker service update --force ${resourceName}`;
} else {
} else if (resourceType === "standalone") {
command = `docker restart ${resourceName}`;
} else {
throw new Error("Resource type not found");
}
if (serverId) {
await execAsyncRemote(serverId, command);

View File

@@ -578,8 +578,7 @@ export const createTraefikInstance = () => {
TRAEFIK_VERSION=${TRAEFIK_VERSION}
docker run -d \
--name dokploy-traefik \
--network dokploy-network \
--restart unless-stopped \
--restart always \
-v /etc/dokploy/traefik/traefik.yml:/etc/traefik/traefik.yml \
-v /etc/dokploy/traefik/dynamic:/etc/dokploy/traefik/dynamic \
-v /var/run/docker.sock:/var/run/docker.sock \
@@ -587,6 +586,8 @@ export const createTraefikInstance = () => {
-p ${TRAEFIK_PORT}:${TRAEFIK_PORT} \
-p ${TRAEFIK_HTTP3_PORT}:${TRAEFIK_HTTP3_PORT}/udp \
traefik:v$TRAEFIK_VERSION
docker network connect dokploy-network dokploy-traefik;
echo "Traefik version $TRAEFIK_VERSION installed ✅"
fi
`;