Compare commits
No commits in common. "5627f147e39c6a309e3bd42ce741951ccd7bde00" and "8901c549aa589036fce446274a4c57c2fff1973b" have entirely different histories.
5627f147e3
...
8901c549aa
25
Dockerfile
25
Dockerfile
|
@ -1,25 +0,0 @@
|
||||||
# --- 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;"]
|
|
|
@ -1,27 +0,0 @@
|
||||||
|
|
||||||
access_log off; # 推荐关闭
|
|
||||||
|
|
||||||
server {
|
|
||||||
# 监听容器内的 80 端口
|
|
||||||
listen 80;
|
|
||||||
|
|
||||||
# 静态文件根目录
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
|
|
||||||
# 默认首页
|
|
||||||
index index.html;
|
|
||||||
|
|
||||||
# 核心路由配置 (与 sys-ui 完全相同)
|
|
||||||
# 因为网关已经剥离了 /lmg/ 前缀,所以这里直接处理根路径即可
|
|
||||||
location / {
|
|
||||||
try_files $uri $uri/ /index.html;
|
|
||||||
}
|
|
||||||
|
|
||||||
# 缓存配置 (与 sys-ui 相同)
|
|
||||||
location ~* \.(?:css|js|gif|ico|jpe?g|png|svg|woff2?)$ {
|
|
||||||
expires 7d;
|
|
||||||
add_header Cache-Control "public";
|
|
||||||
access_log off;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue