RAGflow/management/Dockerfile

34 lines
951 B
Docker
Raw Normal View History

2025-03-28 22:45:42 +08:00
# 前端构建阶段
FROM node:18 AS frontend-builder
WORKDIR /app/frontend
COPY web /app/frontend
# 安装 pnpm
RUN npm install -g pnpm
# 设置环境变量禁用交互式提示
ENV CI=true
# 安装依赖并构建
RUN pnpm i && pnpm build
# 前端服务阶段
FROM nginx:alpine AS frontend
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=frontend-builder /app/frontend/dist /usr/share/nginx/html
# 暴露前端端口
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
# 后端构建阶段
FROM python:3.10.16 AS backend
# 安装 LibreOffice 及字体支持
RUN apt-get update && \
apt-get install -y libreoffice fonts-noto-cjk && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
2025-03-28 22:45:42 +08:00
WORKDIR /app
COPY server/requirements.txt /app/
# 安装依赖
RUN pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
# 复制后端代码
COPY server /app
# 暴露后端端口
EXPOSE 5000
CMD ["python", "app.py"]