Skip to content

Commit 899e31e

Browse files
author
RSSHub-Py
committed
update dockerfile for xuqiu rss
1 parent 88faaf3 commit 899e31e

File tree

4 files changed

+60
-13
lines changed

4 files changed

+60
-13
lines changed

.dockerignore

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,40 @@
1-
vercel.json
2-
tests
3-
bin
1+
# 版本控制
2+
.git
3+
.gitignore
4+
5+
# Python 缓存
6+
__pycache__/
7+
*.pyc
8+
*.pyo
9+
*.pyd
10+
*.log
11+
12+
# 虚拟环境
13+
venv/
14+
env/
15+
.venv/
16+
17+
# Node / 前端
18+
node_modules/
19+
*.tsbuildinfo
20+
21+
# Docker 本身
22+
Dockerfile
23+
docker-compose.yml
24+
25+
# 本地配置
26+
*.swp
27+
*.swo
28+
*.bak
29+
*.tmp
30+
31+
# 测试和文档
32+
tests/
33+
docs/
34+
*.md
35+
36+
# 其他不需要的文件
437
Pipfile
5-
Pipfile.lock
38+
Pipfile.lock
39+
bin/
40+
vercel.json

Dockerfile

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,28 @@
1-
# 使用官方的 Python 镜像作为基础镜像
2-
FROM python:3.12.3-slim
1+
FROM python:3.12-slim
32

4-
# 设置工作目录
3+
# Install system dependencies for Chrome/Chromedriver
4+
RUN echo "deb http://mirrors.aliyun.com/debian trixie main contrib non-free non-free-firmware" > /etc/apt/sources.list && \
5+
echo "deb http://mirrors.aliyun.com/debian trixie-updates main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
6+
echo "deb http://mirrors.aliyun.com/debian-security trixie-security main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \
7+
apt-get update && apt-get install -y \
8+
wget gnupg unzip curl \
9+
chromium chromium-driver \
10+
fonts-liberation libnss3 libxi6 libxcursor1 libxrandr2 libxss1 libxcomposite1 libasound2 \
11+
&& rm -rf /var/lib/apt/lists/*
12+
13+
14+
15+
# Set working directory
516
WORKDIR /app
617

7-
# 复制应用程序代码
18+
# Copy application code
819
COPY . .
920

10-
# 安装Python依赖
21+
# Install Python dependencies
1122
RUN pip install --no-cache-dir -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple
1223

13-
# 暴露端口
24+
# Expose port
1425
EXPOSE 5000
1526

16-
# 启动应用程序
17-
CMD ["gunicorn", "-b", "0.0.0.0:5000", "main:app"]
27+
# Start app
28+
CMD ["gunicorn", "-b", "0.0.0.0:5000", "main:app", "--timeout", "120", "--workers", "2"]

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ click==8.0.3
55
cssselect==1.2.0
66
feedparser==6.0.8
77
Flask==2.0.2
8+
gunicorn
89
Werkzeug==2.0.3
910
Flask_Analytics==0.6.0
1011
Flask_Caching==2.0.2

rsshub/templates/main/feeds.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ <h6 class="text-muted">问题 <a href="https://github.com/JeffersonYoung" target
719719
<h4 class="card-title">雪球用户动态</h4>
720720

721721
<h6 class="text-muted">用户动态 <a href="https://github.com/hillerliao" target="_blank" class="badge badge-secondary">by hillerliao</a></h6>
722-
<p class="card-text">举例:<a href="https://pyrsshub.vercel.app/xueqiu/user/1015215555" target="_blank">https://pyrsshub.vercel.app/xueqiu/user/1015215555</a></p>
722+
<p class="card-text">举例:<a href="https://pyrsshub.vercel.app/xueqiu/user/1247347556" target="_blank">https://pyrsshub.vercel.app/xueqiu/user/1247347556</a></p>
723723
<p class="card-text">路由:<code>/xueqiu/user/:user_id</code></p>
724724
<p class="card-text">user_id [必填, 雪球用户ID,在用户个人主页URL中获取] </p>
725725
<p class="card-text">功能:获取指定雪球用户的最新动态和发言</p>

0 commit comments

Comments
 (0)