Skip to content

Commit 2ab3bd3

Browse files
committed
fix(compose): add trailing newline to migration and MTU mismatch check
Add missing trailing newline to migration SQL file. Log an info message during deployment when the isolated network's current MTU differs from the configured value, indicating the network must be recreated.
1 parent 437c44d commit 2ab3bd3

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ALTER TABLE "compose" ADD COLUMN "isolatedNetworkMtu" integer;
1+
ALTER TABLE "compose" ADD COLUMN "isolatedNetworkMtu" integer;

packages/server/src/utils/builders/compose.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ Compose Type: ${composeType} ✅`;
5353
5454
cd "${projectPath}";
5555
56-
${compose.isolatedDeployment ? `docker network inspect ${compose.appName} >/dev/null 2>&1 || docker network create ${compose.composeType === "stack" ? "--driver overlay" : ""} --attachable ${compose.composeType !== "stack" && compose.isolatedNetworkMtu ? `--opt com.docker.network.driver.mtu=${compose.isolatedNetworkMtu}` : ""} ${compose.appName}` : ""}
56+
${compose.isolatedDeployment ? `
57+
if docker network inspect ${compose.appName} >/dev/null 2>&1; then
58+
${compose.composeType !== "stack" && compose.isolatedNetworkMtu ? `CURRENT_MTU=$(docker network inspect ${compose.appName} --format '{{index .Options "com.docker.network.driver.mtu"}}'); if [ "$CURRENT_MTU" != "${compose.isolatedNetworkMtu}" ]; then echo "Info: Network ${compose.appName} has MTU $CURRENT_MTU but configured MTU is ${compose.isolatedNetworkMtu}. The network must be recreated for the new MTU to take effect."; fi` : "true"}
59+
else
60+
docker network create ${compose.composeType === "stack" ? "--driver overlay" : ""} --attachable ${compose.composeType !== "stack" && compose.isolatedNetworkMtu ? `--opt com.docker.network.driver.mtu=${compose.isolatedNetworkMtu}` : ""} ${compose.appName}
61+
fi` : ""}
5762
env -i PATH="$PATH" ${exportEnvCommand} docker ${command.split(" ").join(" ")} 2>&1 || { echo "Error: ❌ Docker command failed"; exit 1; }
5863
${compose.isolatedDeployment ? `docker network connect ${compose.appName} $(docker ps --filter "name=dokploy-traefik" -q) >/dev/null 2>&1` : ""}
5964

0 commit comments

Comments
 (0)