mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-13 23:45:17 +00:00
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:
@@ -277,6 +277,7 @@ export const getDockerResourceType = async (
|
|||||||
const { stdout } = await execAsync(command);
|
const { stdout } = await execAsync(command);
|
||||||
result = stdout.trim();
|
result = stdout.trim();
|
||||||
}
|
}
|
||||||
|
console.log("result", result);
|
||||||
if (result === "service") {
|
if (result === "service") {
|
||||||
return "service";
|
return "service";
|
||||||
}
|
}
|
||||||
@@ -291,11 +292,14 @@ export const reloadDockerResource = async (
|
|||||||
serverId?: string,
|
serverId?: string,
|
||||||
) => {
|
) => {
|
||||||
const resourceType = await getDockerResourceType(resourceName, serverId);
|
const resourceType = await getDockerResourceType(resourceName, serverId);
|
||||||
|
console.log("resourceType", resourceType);
|
||||||
let command = "";
|
let command = "";
|
||||||
if (resourceType === "service") {
|
if (resourceType === "service") {
|
||||||
command = `docker service update --force ${resourceName}`;
|
command = `docker service update --force ${resourceName}`;
|
||||||
} else {
|
} else if (resourceType === "standalone") {
|
||||||
command = `docker restart ${resourceName}`;
|
command = `docker restart ${resourceName}`;
|
||||||
|
} else {
|
||||||
|
throw new Error("Resource type not found");
|
||||||
}
|
}
|
||||||
if (serverId) {
|
if (serverId) {
|
||||||
await execAsyncRemote(serverId, command);
|
await execAsyncRemote(serverId, command);
|
||||||
|
|||||||
@@ -578,8 +578,7 @@ export const createTraefikInstance = () => {
|
|||||||
TRAEFIK_VERSION=${TRAEFIK_VERSION}
|
TRAEFIK_VERSION=${TRAEFIK_VERSION}
|
||||||
docker run -d \
|
docker run -d \
|
||||||
--name dokploy-traefik \
|
--name dokploy-traefik \
|
||||||
--network dokploy-network \
|
--restart always \
|
||||||
--restart unless-stopped \
|
|
||||||
-v /etc/dokploy/traefik/traefik.yml:/etc/traefik/traefik.yml \
|
-v /etc/dokploy/traefik/traefik.yml:/etc/traefik/traefik.yml \
|
||||||
-v /etc/dokploy/traefik/dynamic:/etc/dokploy/traefik/dynamic \
|
-v /etc/dokploy/traefik/dynamic:/etc/dokploy/traefik/dynamic \
|
||||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||||
@@ -587,6 +586,8 @@ export const createTraefikInstance = () => {
|
|||||||
-p ${TRAEFIK_PORT}:${TRAEFIK_PORT} \
|
-p ${TRAEFIK_PORT}:${TRAEFIK_PORT} \
|
||||||
-p ${TRAEFIK_HTTP3_PORT}:${TRAEFIK_HTTP3_PORT}/udp \
|
-p ${TRAEFIK_HTTP3_PORT}:${TRAEFIK_HTTP3_PORT}/udp \
|
||||||
traefik:v$TRAEFIK_VERSION
|
traefik:v$TRAEFIK_VERSION
|
||||||
|
|
||||||
|
docker network connect dokploy-network dokploy-traefik;
|
||||||
echo "Traefik version $TRAEFIK_VERSION installed ✅"
|
echo "Traefik version $TRAEFIK_VERSION installed ✅"
|
||||||
fi
|
fi
|
||||||
`;
|
`;
|
||||||
|
|||||||
Reference in New Issue
Block a user