feat: auto-migrate on deploy, static file serving fix
This commit is contained in:
@@ -56,9 +56,11 @@ docker tag "harats-server:$DOCKER_TAG" harats-server:latest 2>/dev/null || true
|
|||||||
echo "[4/5] Starting services..."
|
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
|
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 ──
|
# ── 5. Run migrations + Health check ──
|
||||||
echo "[5/5] Health check (waiting 10s for startup)..."
|
echo "[5/5] Running migrations & health check..."
|
||||||
sleep 10
|
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"}')
|
HEALTH=$(curl -sf "http://localhost:3001/api/health" 2>/dev/null || echo '{"status":"FAIL"}')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user