Fix production deploy Traefik reuse
Build & Push / Build & Push Docker Image (push) Successful in 53s
Build & Push / Build & Push Docker Image (push) Successful in 53s
- 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
This commit is contained in:
@@ -456,6 +456,13 @@ wait_for_healthy() {
|
|||||||
start_traefik() {
|
start_traefik() {
|
||||||
ensure_env_file
|
ensure_env_file
|
||||||
ensure_traefik_network
|
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
|
traefik_compose up -d
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -503,6 +503,13 @@ start_traefik() {
|
|||||||
ensure_env_file
|
ensure_env_file
|
||||||
ensure_traefik_network
|
ensure_traefik_network
|
||||||
render_registry_proxy_config
|
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
|
traefik_compose up -d
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user