wecom-dashboards/ruoyi-ui/Dockerfile

33 lines
616 B
Docker
Raw Permalink Normal View History

2026-02-08 08:22:43 +00:00
# 前端 Dockerfile
FROM node:14 AS build
# 设置工作目录
WORKDIR /app
# 复制 package.json 和 package-lock.json
COPY package*.json ./
# 安装依赖
RUN npm install --registry=https://registry.npmmirror.com
# 复制源代码
COPY . .
# 构建生产环境代码
RUN npm run build:prod
# 使用 Nginx 作为生产环境服务器
FROM nginx:alpine
# 复制构建好的文件到 Nginx
COPY --from=build /app/dist /usr/share/nginx/html/ashai-wecom-test
# 复制 Nginx 配置文件
COPY nginx.conf /etc/nginx/conf.d/default.conf
# 暴露端口
EXPOSE 80
# 启动 Nginx
CMD ["nginx", "-g", "daemon off;"]