From fb8c7ce76a25dd9ea72e0b6d9c731483314f5581 Mon Sep 17 00:00:00 2001 From: Eugenius-Anonymous Date: Mon, 8 Jun 2026 16:27:17 +0700 Subject: [PATCH] feat: auto-migrate on deploy, static file serving fix --- deploy/deploy-remote.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/deploy/deploy-remote.sh b/deploy/deploy-remote.sh index 8edea60..577825c 100644 --- a/deploy/deploy-remote.sh +++ b/deploy/deploy-remote.sh @@ -56,9 +56,11 @@ docker tag "harats-server:$DOCKER_TAG" harats-server:latest 2>/dev/null || true echo "[4/5] Starting services..." BUILD_VERSION="$DOCKER_TAG" docker compose -p "$PROJECT_NAME" -f "$DEPLOY_DIR/$COMPOSE_FILE" up -d --remove-orphans --no-build 2>&1 -# ── 5. Health check ── -echo "[5/5] Health check (waiting 10s for startup)..." -sleep 10 +# ── 5. Run migrations + Health check ── +echo "[5/5] Running migrations & health check..." +sleep 5 +docker exec harats-server-1 npx -y prisma migrate deploy --schema /app/prisma/schema.prisma 2>&1 || echo " ⚠️ Migration warning (may be first run)" +sleep 5 HEALTH=$(curl -sf "http://localhost:3001/api/health" 2>/dev/null || echo '{"status":"FAIL"}')