partner-admin/Dockerfile
2025-03-08 20:40:43 +08:00

32 lines
568 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 构建阶段
FROM node:18-alpine as build-stage
# 设置工作目录
WORKDIR /app
# 复制package.json和package-lock.json
COPY package*.json ./
# 安装依赖
RUN npm install
# 复制项目文件
COPY . .
# 构建项目
RUN npm run build
# 生产阶段
FROM nginx:stable-alpine as production-stage
# 复制构建结果到Nginx目录
COPY --from=build-stage /app/dist /usr/share/nginx/html
# 复制自定义Nginx配置可选
# COPY nginx.conf /etc/nginx/conf.d/default.conf
# 暴露80端口
EXPOSE 80
# 启动Nginx
CMD ["nginx", "-g", "daemon off;"]