- Backend (FastAPI, SQLAlchemy 2, Alembic): single-admin cookie auth, news/crawler/market APIs with SSE and WebSocket streaming - Crawler (Scrapy + Scrapy-Redis): wscn_news, wscn_live, cls_depth, cls_telegraph spiders, idempotent upserts with revisions, raw response archiving, per-source subprocess supervision, restart and backoff - Market worker: full-history Binance spot/USD-M kline backfill, realtime WS stream, hourly and on-reconnect catch-up - Frontend (Vue 3, Element Plus, UnoCSS, KLineChart): news feed, crawler console with live logs, Binance-style chart page - Deploy: docker compose, nginx site, migrate and daily backup scripts
11 lines
363 B
Bash
Executable File
11 lines
363 B
Bash
Executable File
#!/bin/sh
|
|
# 迁移前先备份:只有一套环境,迁移即生产操作
|
|
set -eu
|
|
cd "$(dirname "$0")"
|
|
mkdir -p ../backups
|
|
dump="../backups/alphapulse-premigrate-$(date +%Y%m%d-%H%M%S).dump"
|
|
docker exec postgres pg_dump -U alphapulse -Fc alphapulse > "$dump"
|
|
echo "已备份:$dump"
|
|
docker compose build api
|
|
docker compose run --rm -T api alembic upgrade head
|