Spaces:
Paused
Paused
| # 使用合适的基础镜像 | |
| FROM ubuntu:20.04 | |
| RUN apt-get update && apt-get install -y tzdata | |
| ENV TZ=Asia/Shanghai | |
| RUN dpkg-reconfigure -f noninteractive tzdata | |
| # 更新并安装所需的依赖 | |
| RUN apt-get update && apt-get install -y \ | |
| mysql-server \ | |
| nginx \ | |
| nodejs \ | |
| npm \ | |
| python3-pip \ | |
| curl \ | |
| wget \ | |
| supervisor \ | |
| curl \ # 之前重复的 curl | |
| gnupg2 \ | |
| lsb-release \ | |
| openssl \ | |
| iputils-ping \ | |
| net-tools \ | |
| unzip \ | |
| apt-transport-https \ | |
| ca-certificates \ | |
| software-properties-common \ | |
| docker.io \ # 安装 Docker CLI | |
| git \ # 安装 git | |
| && apt-get clean | |
| # 设置工作目录 | |
| WORKDIR /ragflow | |
| # 复制各个服务的文件 | |
| COPY ./web ./web | |
| COPY ./api ./api | |
| COPY ./conf ./conf | |
| COPY ./deepdoc ./deepdoc | |
| COPY ./rag ./rag | |
| COPY ./agent ./agent | |
| COPY ./graphrag ./graphrag | |
| # 安装Web应用的依赖并构建 | |
| RUN cd ./web && npm install --force && npm run build | |
| # 设置环境变量 | |
| ENV PYTHONPATH=/ragflow/ | |
| ENV HF_ENDPOINT=https://hf-mirror.com | |
| # 复制Supervisord配置文件 | |
| COPY ./supervisord.conf /etc/supervisor/conf.d/supervisord.conf | |
| # 复制启动脚本 | |
| COPY ./docker/entrypoint.sh /usr/local/bin/entrypoint.sh | |
| RUN chmod +x /usr/local/bin/entrypoint.sh | |
| # 设置启动时执行的命令 | |
| ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] | |