fix: correct frontend Dockerfile path for vite build

This commit is contained in:
2026-02-28 16:13:47 +08:00
parent 2e6d8c28c4
commit e31c946f94

View File

@@ -1,25 +1,26 @@
# 医院绩效考核系统 - 前端 Dockerfile
FROM node:18-alpine AS builder
WORKDIR /app
WORKDIR /app/frontend
# 复制 package 文件
COPY frontend/package*.json ./
COPY frontend/package*.json ./frontend/
# 安装依赖
RUN npm install --production
RUN npm install
# 复制源代码
COPY frontend/ ./
COPY frontend/ ./frontend/
# 构建前端
RUN npm run build
WORKDIR /app
RUN cd frontend && npm run build
# 生产阶段:使用 Nginx
FROM nginx:alpine
# 复制构建产物
COPY --from=builder /app/dist /usr/share/nginx/html
COPY --from=builder /app/frontend/dist /usr/share/nginx/html
# 复制 Nginx 配置
COPY frontend/nginx.conf /etc/nginx/conf.d/default.conf