Spaces:
Sleeping
Sleeping
Download Dockerfile from zeeeeef/Competitive-Analysis2: direct link, hf CLI and curl.
- Browser
- Download file 1.32 kB
-
https://huggingface.co/spaces/zeeeeef/Competitive-Analysis2/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/zeeeeef/Competitive-Analysis2/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/zeeeeef/Competitive-Analysis2/resolve/main/Dockerfile
1.32 kB
| FROM python:3.12-slim | |
| WORKDIR /app | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| curl \ | |
| software-properties-common \ | |
| git \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # 复制需求文件和应用代码 | |
| COPY requirements.txt ./ | |
| COPY app.py ./ | |
| # 安装 Python 依赖 | |
| RUN pip3 install --no-cache-dir -r requirements.txt | |
| # 创建所有可能需要的目录并给予完全权限 | |
| RUN mkdir -p /tmp/.streamlit && chmod 777 /tmp/.streamlit && \ | |
| mkdir -p /app/.streamlit && chmod 777 /app/.streamlit && \ | |
| mkdir -p /.streamlit && chmod 777 /.streamlit && \ | |
| mkdir -p /app/extracted_images && chmod 777 /app/extracted_images && \ | |
| mkdir -p /tmp/streamlit_temp && chmod 777 /tmp/streamlit_temp && \ | |
| mkdir -p /root/.streamlit && chmod 777 /root/.streamlit && \ | |
| chmod 777 /app | |
| # 设置环境变量 | |
| ENV STREAMLIT_SERVER_HEADLESS=true | |
| ENV STREAMLIT_SERVER_ENABLE_CORS=false | |
| ENV STREAMLIT_SERVER_PORT=8501 | |
| ENV STREAMLIT_CONFIG_DIR=/tmp/.streamlit | |
| ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=false | |
| # 暴露端口 | |
| EXPOSE 8501 | |
| # 健康检查 | |
| HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health | |
| # 启动命令 | |
| CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.enableXsrfProtection=false", "--server.enableWebsocketCompression=false"] |