Spaces:
Paused
Paused
| FROM ghcr.io/open-webui/open-webui:main | |
| WORKDIR /app/backend | |
| # 创建必要的目录 | |
| RUN mkdir -p /app/backend/static | |
| RUN mkdir -p /app/backend/data | |
| RUN mkdir -p /app/cache | |
| RUN mkdir -p /app/backend/data/functions | |
| RUN mkdir -p /app/backend/data/tools | |
| # 安装必要的依赖 | |
| RUN apt-get update && apt-get install -y apache2-utils sqlite3 | |
| RUN pip install einops | |
| # 安装 Cloudflare CLI 工具 | |
| COPY --from=cloudflare/cloudflared:latest /usr/local/bin/cloudflared /usr/local/bin/cloudflared | |
| # 设置权限 | |
| RUN chmod -R 777 /app/backend/static | |
| RUN chmod -R 777 /app/backend/data | |
| RUN chmod -R 777 /app/cache | |
| # 设置环境变量 | |
| ENV HF_HOME="/app/backend/data/cache/embedding/models" | |
| ENV WHISPER_MODEL="base" \ | |
| WHISPER_MODEL_DIR="/app/backend/data/cache/whisper/models" | |
| # 信任远程代码 | |
| ENV RAG_RERANKING_MODEL_TRUST_REMOTE_CODE=True | |
| ENV RAG_EMBEDDING_MODEL_TRUST_REMOTE_CODE=True | |
| # 复制并设置权限 | |
| COPY artifacts.py /app/backend/data/functions/artifacts.py | |
| COPY function-Artifacts.json /app/backend/data/functions/function-Artifacts.json | |
| RUN chmod -R 777 /app/backend/data/functions/artifacts.py | |
| RUN chmod -R 777 /app/backend/data/functions/function-Artifacts.json | |
| COPY search.py /app/backend/data/tools/search.py | |
| COPY calculator.py /app/backend/data/tools/calculator.py | |
| COPY weather.py /app/backend/data/tools/weather.py | |
| RUN chmod -R 777 /app/backend/data/tools/search.py | |
| RUN chmod -R 777 /app/backend/data/tools/calculator.py | |
| RUN chmod -R 777 /app/backend/data/tools/weather.py | |
| # 数据库连接避免报错 | |
| ENV PGSSLCERT /tmp/postgresql.crt | |
| # 暴露服务端口 | |
| EXPOSE 8080 | |
| # 设置启动命令 | |
| CMD cloudflared tunnel --no-autoupdate run --token $CF_TOKEN & \ | |
| bash start.sh |