25 lines
421 B
Docker
25 lines
421 B
Docker
FROM node:18-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# 安装uni-app CLI
|
|
RUN npm install -g @vue/cli @dcloudio/uni-cli-common
|
|
|
|
COPY frontend/package.json ./
|
|
RUN npm install
|
|
|
|
COPY frontend/ ./
|
|
RUN npm run build:h5
|
|
|
|
FROM nginx:alpine
|
|
|
|
# 复制构建产物
|
|
COPY --from=builder /app/dist/build/h5 /usr/share/nginx/html
|
|
|
|
# 复制nginx配置
|
|
COPY deploy/nginx.conf /etc/nginx/nginx.conf
|
|
|
|
EXPOSE 80
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|