20 lines
658 B
Nginx Configuration File
20 lines
658 B
Nginx Configuration File
# ================= Dockerfile (前端 Nginx 构建) =================
|
||
FROM node:14-alpine AS builder
|
||
WORKDIR /app
|
||
COPY package*.json ./
|
||
RUN npm install --registry=https://registry.npmmirror.com
|
||
COPY . .
|
||
RUN npm run build
|
||
|
||
# ================= 生产镜像 =================
|
||
FROM nginx:alpine
|
||
# Nginx 配置
|
||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||
# 复制构建产物(vue.config.js 中 outputDir: '数字园区项目')
|
||
COPY --from=builder /app/数字园区项目 /usr/share/nginx/html
|
||
EXPOSE 80
|
||
|
||
FROM nginx:alpine
|
||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||
# vue.config.js outputDir = '数字园区项目'
|
||
COPY E:\project\web\vue\园区项目\ |