Spaces:
Runtime error
Runtime error
| FROM langgenius/dify-sandbox:0.2.12 | |
| ENV API_KEY=dify-sandbox \ | |
| GIN_MODE=release \ | |
| WORKER_TIMEOUT=15 \ | |
| ENABLE_NETWORK=true \ | |
| HTTP_PROXY=https://yixian56-ssrf-proxy.hf.space \ | |
| HTTPS_PROXY=https://yixian56-ssrf-proxy.hf.space \ | |
| SANDBOX_PORT=8194 | |
| # 创建必要的目录 | |
| WORKDIR /app | |
| RUN mkdir -p logs /dependencies /conf /app/conf /var/sandbox/sandbox-nodejs | |
| # 创建 Python 依赖文件 | |
| RUN echo '# Python依赖列表 \ | |
| requests==2.31.0 \ | |
| beautifulsoup4==4.12.2 \ | |
| numpy==1.26.1 \ | |
| pandas==2.1.1 \ | |
| matplotlib==3.8.0 \ | |
| ' > /dependencies/python-requirements.txt | |
| # 复制本地配置文件到容器内 | |
| COPY config.yaml /app/conf/config.yaml | |
| # 使用root权限预先创建Python沙箱目录 | |
| USER root | |
| RUN mkdir -p /var/sandbox/sandbox-python && \ | |
| chmod -R 777 /var/sandbox && \ | |
| # 确保日志目录有正确权限 | |
| chmod -R 777 /app/logs | |
| # 健康检查 | |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ | |
| CMD curl -f http://localhost:8194/health || exit 1 | |
| # 暴露沙盒服务端口 | |
| EXPOSE 8194 | |
| # 启动沙盒服务 | |
| CMD ["/app/sandbox"] | |