From 9e096f02164eb94e21d607068d839268f776a967 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 4 Jul 2026 17:39:22 -0400 Subject: [PATCH] Fix production deploy Traefik reuse - pass NEXT_PUBLIC_CARPLACE_URL into the production Docker build - run the production deploy script after building the image - support raw or base64 production env secrets during deploy - copy the production env file into the remote build context - include homepage in production deploy, pull, and health checks - use a stable Traefik Compose project name - reuse an existing Traefik container instead of starting a duplicate proxy --- production/scripts/docker-prod-common.sh | 7 +++++++ scripts/docker-prod-common.sh | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/production/scripts/docker-prod-common.sh b/production/scripts/docker-prod-common.sh index 72bbf2b..ffb5d78 100755 --- a/production/scripts/docker-prod-common.sh +++ b/production/scripts/docker-prod-common.sh @@ -456,6 +456,13 @@ wait_for_healthy() { start_traefik() { ensure_env_file ensure_traefik_network + local existing_proxy + existing_proxy="$(docker ps --filter publish=80 --format '{{.ID}} {{.Image}} {{.Names}}' | awk 'tolower($0) ~ /traefik/ { print $1; exit }')" + if [[ -n "${existing_proxy}" ]]; then + echo "Using existing Traefik container ${existing_proxy}; skipping duplicate Traefik startup." + docker network connect "${TRAEFIK_NETWORK}" "${existing_proxy}" 2>/dev/null || true + return 0 + fi traefik_compose up -d } diff --git a/scripts/docker-prod-common.sh b/scripts/docker-prod-common.sh index d8472f1..0dd7161 100644 --- a/scripts/docker-prod-common.sh +++ b/scripts/docker-prod-common.sh @@ -503,6 +503,13 @@ start_traefik() { ensure_env_file ensure_traefik_network render_registry_proxy_config + local existing_proxy + existing_proxy="$(docker ps --filter publish=80 --format '{{.ID}} {{.Image}} {{.Names}}' | awk 'tolower($0) ~ /traefik/ { print $1; exit }')" + if [[ -n "${existing_proxy}" ]]; then + echo "Using existing Traefik container ${existing_proxy}; skipping duplicate Traefik startup." + docker network connect "${TRAEFIK_NETWORK}" "${existing_proxy}" 2>/dev/null || true + return 0 + fi traefik_compose up -d }