GitHub 开发者 / 仓库 / 趋势榜单项目。
当前部署模式为前后端分离:
/html/ailuntz.com_rankings)生产环境 API 建议路径:
https://api.ailuntz.com/rankings/healthhttps://api.ailuntz.com/rankings/data/repos.jsonailuntz.com_rankings/
├── frontend/ # 前端(Vite + React)
├── rank/ # 后端采集与 API(Node + TS)
├── Dockerfile.rankings # 后端容器镜像
└── README.md
docker run -d --name ailuntz-rankings -p 3001:8080 \
-e GITHUB_TOKEN=YOUR_GITHUB_TOKEN \
-e FETCH_TIMEZONE=Asia/Shanghai \
-e MAX_RANK=200 \
-e API_PREFIX=/rankings \
-e TASK_DELAY_MS=10000 \
-e CORS_ALLOW_ORIGIN=* \
-v ailuntz_ranking_data:/app/data \
ailuntz/rankings:latest
GITHUB_TOKEN: GitHub token(必填,避免低额度)FETCH_TIMEZONE: 调度时区,默认 Asia/ShanghaiMAX_RANK: 每类榜单最大条数,默认 200API_PREFIX: API 前缀,默认 /rankingsTASK_DELAY_MS: 任务间隔毫秒,默认 10000CORS_ALLOW_ORIGIN: 跨域来源,默认 *DATA_DIR: 数据目录,默认 ./dataAUTO_FETCH: 是否自动调度,默认 trueserver {
listen 443 ssl;
http2 on;
server_name api.ailuntz.com;
ssl_certificate /usr/share/nginx/html_cert/ailuntz.com.pem;
ssl_certificate_key /usr/share/nginx/html_cert/ailuntz.com.key;
location /rankings/ {
proxy_pass http://127.0.0.1:3001;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_read_timeout 60s;
}
location / {
proxy_pass http://127.0.0.1:3000;
}
}
cd frontend
npm install
npm run build
rm -rf /Volumes/usb_main/usb_web/html/ailuntz.com_rankings/*
cp -R dist/* /Volumes/usb_main/usb_web/html/ailuntz.com_rankings/
前端默认读取:
VITE_API_BASE_URL=https://api.ailuntz.comVITE_API_PREFIX=/rankingsTASK_DELAY_MS 并使用有效 token。Content type
Image
Digest
sha256:aa02a263a…
Size
50 MB
Last updated
7 months ago
docker pull ailuntz/rankings