19 lines
385 B
Docker
19 lines
385 B
Docker
# 构建阶段
|
|
FROM 192.168.195.25:19900/library/node:20-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci --registry=https://registry.npmmirror.com
|
|
|
|
COPY . .
|
|
RUN npx vite build
|
|
|
|
# 运行阶段
|
|
FROM 192.168.195.25:19900/library/nginx:alpine
|
|
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
EXPOSE 80
|