fix: restart deployed app containers after platform start
podman system migrate explicitly stops all containers, which overrides the --restart unless-stopped policy set on deployed apps. After compose up-d brings the infra stack back, any exited hiy-* container is now restarted automatically. Same logic added to boot.sh for the on-boot path. https://claude.ai/code/session_01FKCW3FDjNFj6jve4niMFXH
This commit is contained in:
parent
88f6e02d4e
commit
852e3f6ccb
2 changed files with 17 additions and 0 deletions
|
|
@ -56,4 +56,13 @@ fi
|
|||
# ── Bring up the stack ─────────────────────────────────────────────────────────
|
||||
podman system migrate
|
||||
podman compose --env-file "$REPO_ROOT/.env" -f "$SCRIPT_DIR/docker-compose.yml" up -d
|
||||
|
||||
# ── Restart deployed app containers ───────────────────────────────────────────
|
||||
podman ps -a --filter "status=exited" --format "{{.Names}}" \
|
||||
| grep '^hiy-' \
|
||||
| while IFS= read -r name; do
|
||||
echo "[hiy] Restarting app: $name"
|
||||
podman start "$name" || true
|
||||
done
|
||||
|
||||
echo "[hiy] Stack is up."
|
||||
|
|
|
|||
|
|
@ -187,6 +187,14 @@ podman system migrate
|
|||
podman compose --env-file "$REPO_ROOT/.env" -f "$SCRIPT_DIR/docker-compose.yml" down
|
||||
podman compose --env-file "$REPO_ROOT/.env" -f "$SCRIPT_DIR/docker-compose.yml" up -d
|
||||
|
||||
# ── Restart deployed app containers (stopped by podman system migrate above) ───
|
||||
podman ps -a --filter "status=exited" --format "{{.Names}}" \
|
||||
| grep '^hiy-' \
|
||||
| while IFS= read -r name; do
|
||||
echo "[hiy] Restarting app: $name"
|
||||
podman start "$name" || true
|
||||
done
|
||||
|
||||
# ── Install systemd user service for auto-start on boot ───────────────────────
|
||||
# Uses a user-level (rootless) service so Podman's UID namespace is preserved.
|
||||
# loginctl enable-linger lets the service start even without an active login.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue