Skip to content

Commit 3891798

Browse files
authored
Merge pull request #2527 from Dokploy/fix/connect-network-after-creation-remote-servers
Fix/connect network after creation remote servers
2 parents e637a4a + 3662c1a commit 3891798

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

packages/server/src/services/settings.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ export const getDockerResourceType = async (
277277
const { stdout } = await execAsync(command);
278278
result = stdout.trim();
279279
}
280+
console.log("result", result);
280281
if (result === "service") {
281282
return "service";
282283
}
@@ -291,11 +292,14 @@ export const reloadDockerResource = async (
291292
serverId?: string,
292293
) => {
293294
const resourceType = await getDockerResourceType(resourceName, serverId);
295+
console.log("resourceType", resourceType);
294296
let command = "";
295297
if (resourceType === "service") {
296298
command = `docker service update --force ${resourceName}`;
297-
} else {
299+
} else if (resourceType === "standalone") {
298300
command = `docker restart ${resourceName}`;
301+
} else {
302+
throw new Error("Resource type not found");
299303
}
300304
if (serverId) {
301305
await execAsyncRemote(serverId, command);

packages/server/src/setup/server-setup.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -578,15 +578,16 @@ export const createTraefikInstance = () => {
578578
TRAEFIK_VERSION=${TRAEFIK_VERSION}
579579
docker run -d \
580580
--name dokploy-traefik \
581-
--network dokploy-network \
582-
--restart unless-stopped \
581+
--restart always \
583582
-v /etc/dokploy/traefik/traefik.yml:/etc/traefik/traefik.yml \
584583
-v /etc/dokploy/traefik/dynamic:/etc/dokploy/traefik/dynamic \
585584
-v /var/run/docker.sock:/var/run/docker.sock \
586585
-p ${TRAEFIK_SSL_PORT}:${TRAEFIK_SSL_PORT} \
587586
-p ${TRAEFIK_PORT}:${TRAEFIK_PORT} \
588587
-p ${TRAEFIK_HTTP3_PORT}:${TRAEFIK_HTTP3_PORT}/udp \
589588
traefik:v$TRAEFIK_VERSION
589+
590+
docker network connect dokploy-network dokploy-traefik;
590591
echo "Traefik version $TRAEFIK_VERSION installed ✅"
591592
fi
592593
`;

0 commit comments

Comments
 (0)