games_app/deploy/vps-hardening/remote-migrate-and-up.sh
Your Name 5ce6a6811a
Some checks failed
CI / test-and-build (push) Failing after 25s
Add Gitea CI/CD stack, tloto-deploy, and tagged Compose images
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-17 19:56:39 +02:00

27 lines
743 B
Bash

#!/usr/bin/env bash
set -euo pipefail
cd ~/games_app
echo "== migrate =="
sudo docker compose run --rm --no-deps --build backend node dist/db/migrate.js
echo "MIGRATE_OK"
echo "== compose up (http + clamav) =="
sudo docker compose --profile http --profile clamav up -d --build
echo "COMPOSE_UP_OK"
echo "== ps =="
sudo docker compose ps
echo "== smoke health (wait) =="
for i in $(seq 1 30); do
if curl -fsS -o /dev/null -w "%{http_code}" http://127.0.0.1:9080/api/health 2>/dev/null | grep -qE '200|404|401'; then
echo "HTTP_REACHABLE"
curl -fsS http://127.0.0.1:9080/api/health || curl -fsS http://127.0.0.1:9080/health || true
break
fi
sleep 3
done
sudo docker compose logs --tail=40 backend || true
echo "STACK_DONE"