You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
392 B
20 lines
392 B
FROM node:18-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# 复制前端代码
|
|
COPY frontend/package*.json ./
|
|
RUN npm install --registry=https://registry.npmmirror.com
|
|
|
|
COPY frontend/ ./
|
|
RUN npm run build
|
|
|
|
# 使用 Nginx 提供静态文件
|
|
FROM nginx:alpine
|
|
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
EXPOSE 80
|
|
|
|
CMD ["nginx", "-g", "daemon off;"] |