ForcePilot/docker/web.Dockerfile
Wenjie Zhang b0db3c6b0d feat: 更新 Docker 配置和添加 MinerU OCR 服务
- 修改了 docker-compose.yml,更新了 API 和 Web 服务的镜像名称,并添加了 MinerU OCR 服务。
- 在 pyproject.toml 中添加了 Ruff 代码检查工具的配置。
- 更新了 API 和 Web Dockerfile,添加了代理环境变量。
- 新增了用于拉取 Docker 镜像的脚本。
- 在文档中添加了关于如何使用 MinerU OCR 的说明。
- 优化了代码结构和日志记录,提升了可读性和维护性。
2025-05-23 15:30:14 +08:00

45 lines
1.0 KiB
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 开发阶段
FROM node:latest AS development
WORKDIR /app
ARG http_proxy
ARG https_proxy
ENV http_proxy=$http_proxy \
https_proxy=$https_proxy \
TZ=Asia/Shanghai
# 复制 package.json 和 package-lock.json如果存在
COPY ./web/package*.json ./
# 安装依赖
RUN npm install -g pnpm@latest-10
RUN pnpm install
# RUN npm install --registry http://mirrors.cloud.tencent.com/npm/ --verbose --force
# 复制源代码
COPY ./web .
# 暴露端口
EXPOSE 5173
# 启动开发服务器的命令在 docker-compose 文件中定义
# 生产阶段
FROM node:latest AS build-stage
WORKDIR /app
COPY ./web/package*.json ./
RUN npm install --force
# RUN npm install --registry https://registry.npmmirror.com --force
COPY ./web .
RUN npm run build
# 生产环境运行阶段
FROM nginx:alpine AS production
COPY --from=build-stage /app/dist /usr/share/nginx/html
COPY ./docker/nginx/nginx.conf /etc/nginx/nginx.conf
COPY ./docker/nginx/default.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]