This commit is contained in:
mzl
2026-01-12 15:49:09 +08:00
parent 7c933f4a82
commit 7c0b8c4c09
12 changed files with 383 additions and 175 deletions
+7 -7
View File
@@ -63,7 +63,7 @@ playwright install chromium
python main.py
```
服务将在 `http://localhost:18080` 启动。
服务将在 `http://localhost:18085` 启动。
### 2. 添加用户 ID
@@ -100,7 +100,7 @@ python main.py
```env
HOST=0.0.0.0
PORT=18080
PORT=18085
HEADLESS=false
SCREENSHOT_ON_ERROR=true
MAX_THREADS=5
@@ -180,7 +180,7 @@ docker build -t xiaohongshu-scraper .
```bash
# 本地开发模式(可以看到浏览器窗口)
docker run -d \
-p 18080:18080 \
-p 18085:18085 \
-v $(pwd)/data:/app/data \
-e HEADLESS=false \
--name xiaohongshu-scraper \
@@ -188,7 +188,7 @@ docker run -d \
# 云服务器模式(无头模式)
docker run -d \
-p 18080:18080 \
-p 18085:18085 \
-v $(pwd)/data:/app/data \
-e HEADLESS=true \
--name xiaohongshu-scraper \
@@ -219,7 +219,7 @@ docker exec -it xiaohongshu-scraper bash
| 变量 | 默认值 | 说明 |
|------|--------|------|
| HOST | 0.0.0.0 | 监听地址 |
| PORT | 18080 | 监听端口(范围 10000-50000)|
| PORT | 18085 | 监听端口(范围 10000-50000)|
| HEADLESS | false | 是否无头模式(云服务器设为 true)|
| SCREENSHOT_ON_ERROR | true | 错误时截图 |
| MAX_THREADS | 5 | 最大线程数 |
@@ -266,10 +266,10 @@ environment:
```bash
# 检查 Git 状态
curl http://your-server:18080/api/git/status
curl http://your-server:18085/api/git/status
# 拉取最新代码
curl -X POST http://your-server:18080/api/git/pull
curl -X POST http://your-server:18085/api/git/pull
```
#### 4. 重启容器