mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-13 04:14:57 +00:00
fix(docker): target live cliproxy compose stack
This commit is contained in:
1 parent
c8098532a6
commit
54c3e86e89
3 files changed
+11
-6
No files matched your search
@@ -3,8 +3,8 @@
|
||||
set -Eeuo pipefail
|
||||
|
||||
container_name="${CCS_CLIPROXY_CONTAINER:-ccs-cliproxy}"
|
||||
compose_dir="${CCS_CLIPROXY_COMPOSE_DIR:-/opt/cliproxy}"
|
||||
compose_file="${CCS_CLIPROXY_COMPOSE_FILE:-$compose_dir/docker-compose.yml}"
|
||||
compose_dir="${CCS_CLIPROXY_COMPOSE_DIR:-/root/.ccs/docker}"
|
||||
compose_file="${CCS_CLIPROXY_COMPOSE_FILE:-$compose_dir/docker-compose.integrated.yml}"
|
||||
compose_project="${CCS_CLIPROXY_COMPOSE_PROJECT:-docker}"
|
||||
lock_file="${CCS_CLIPROXY_LOCK_FILE:-/run/lock/ccs-cliproxy-maintenance.lock}"
|
||||
log_file="${CCS_CLIPROXY_RECONCILE_LOG:-/var/log/ccs-cliproxy-reconcile.log}"
|
||||
@@ -52,7 +52,9 @@ compose_recreate() {
|
||||
-f "$compose_file" up -d --force-recreate --build
|
||||
}
|
||||
|
||||
if ! docker inspect "$container_name" >/dev/null 2>&1; then
|
||||
running_state="$(docker inspect --format '{{.State.Running}}' "$container_name" 2>/dev/null || true)"
|
||||
|
||||
if [ -z "$running_state" ]; then
|
||||
log "Container $container_name is missing; recreating from $compose_file"
|
||||
compose_up
|
||||
wait_for_health
|
||||
@@ -60,7 +62,7 @@ if ! docker inspect "$container_name" >/dev/null 2>&1; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$(docker inspect --format '{{.State.Running}}' "$container_name")" != 'true' ]; then
|
||||
if [ "$running_state" != 'true' ]; then
|
||||
log "Container $container_name is stopped; restoring the Compose service"
|
||||
compose_up
|
||||
wait_for_health
|
||||
|
||||
Reference in new issue
Block a user