From 44473e7c99c990aeec491839506c3fc7267c3daf Mon Sep 17 00:00:00 2001 From: yidl Date: Mon, 25 Aug 2025 21:53:00 +0800 Subject: [PATCH] healthy Dockerfile --- Dockerfile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f628b7c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +# --- lmg-ui 构建阶段 --- +FROM 106.52.199.114:5000/node:latest AS builder + +WORKDIR /app + +COPY package*.json ./ +RUN npm ci --frozen-lockfile +COPY . . + +RUN npm run Staging + +# --- lmg-ui 运行阶段 --- +FROM 106.52.199.114:5000/nginx:latest AS runner + +# 复制构建好的静态文件到 Nginx 的 Web 根目录 +COPY --from=builder /app/dist /usr/share/nginx/html + +# 复制自定义的 Nginx 配置文件,处理路由 +# 假设 Nginx 配置在 healthy-ui 项目的根目录,名为 nginx.conf.healthy-ui +COPY nginx.conf.healthy-ui /etc/nginx/conf.d/default.conf + +# 暴露 Nginx 的默认端口 +EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"]