Spaces:
Running
Running
File size: 695 Bytes
9de76b4 7084f2f 9de76b4 7084f2f 9de76b4 7084f2f 9de76b4 efec59a 9de76b4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# 使用RSSHub基础镜像
FROM diygod/rsshub
# 创建用户并设置权限(HuggingFace Spaces要求)
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app
# 设置环境变量
ENV NODE_ENV=production
ENV PORT=7860 # 修改为HuggingFace Spaces默认端口
ENV CACHE_TYPE=memory # 使用内存缓存替代Redis
# 禁用Puppeteer相关配置
# ENV PUPPETEER_WS_ENDPOINT="ws://browserless:3000"
# 暴露端口
EXPOSE 7860
# 健康检查
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:7860/healthz || exit 1
# 启动命令
CMD ["npm", "start", "--", "--port", "7860"] |