From e005f64272d5076df252bcfccb37b2aedae083f5 Mon Sep 17 00:00:00 2001 From: Haouari haitam Kouider <57036855+haouarihk@users.noreply.github.com> Date: Sun, 17 Aug 2025 04:14:19 +0000 Subject: [PATCH] added proxmox lxc detection to script and fall back to --endpoint-mode dnsrr --- apps/website/public/install.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/apps/website/public/install.sh b/apps/website/public/install.sh index e8cf52c5..5a59eb39 100644 --- a/apps/website/public/install.sh +++ b/apps/website/public/install.sh @@ -1,4 +1,20 @@ #!/bin/bash + +# Function to detect if running in Proxmox LXC container +is_proxmox_lxc() { + # Check for LXC in environment + if [ -n "$container" ] && [ "$container" = "lxc" ]; then + return 0 # LXC container + fi + + # Check for LXC in /proc/1/environ + if grep -q "container=lxc" /proc/1/environ 2>/dev/null; then + return 0 # LXC container + fi + + return 1 # Not LXC +} + install_dokploy() { if [ "$(id -u)" != "0" ]; then echo "This script must be run as root" >&2 @@ -39,6 +55,19 @@ install_dokploy() { curl -sSL https://get.docker.com | sh fi + # Check if running in Proxmox LXC container and set endpoint mode + endpoint_mode="" + if is_proxmox_lxc; then + echo "⚠️ WARNING: Detected Proxmox LXC container environment!" + echo "Adding --endpoint-mode dnsrr to Docker service for LXC compatibility." + echo "This may affect service discovery but is required for LXC containers." + echo "" + endpoint_mode="--endpoint-mode dnsrr" + echo "Waiting for 5 seconds before continuing..." + sleep 5 + fi + + docker swarm leave --force 2>/dev/null get_ip() { @@ -145,6 +174,7 @@ install_dokploy() { --update-parallelism 1 \ --update-order stop-first \ --constraint 'node.role == manager' \ + $endpoint_mode \ -e ADVERTISE_ADDR=$advertise_addr \ dokploy/dokploy:latest