Files
admin-ui/Dockerfile

31 lines
676 B
Docker
Raw Normal View History

2026-05-20 17:55:34 +08:00
# ==================== 第一阶段:构建前端 ====================
FROM node:18-alpine AS builder
2025-12-17 10:37:37 +08:00
WORKDIR /app
2026-05-20 17:55:34 +08:00
# 配置Alpine国内镜像源
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
2025-12-17 10:37:37 +08:00
COPY package*.json ./
RUN npm install --registry=https://registry.npmmirror.com
COPY . .
2026-05-20 17:55:34 +08:00
RUN npm run build
# ==================== 第二阶段部署到Nginx ====================
FROM nginx:alpine
# 复制构建产物
COPY --from=builder /app/dist/ /usr/share/nginx/html/
# 复制nginx配置文件
COPY ngnix.conf /etc/nginx/conf.d/default.conf
# 复制SSL证书
COPY ssl/* /etc/nginx/ssl/
2026-05-23 16:28:44 +08:00
EXPOSE 443
2025-12-17 10:37:37 +08:00
2026-05-20 17:55:34 +08:00
CMD ["nginx", "-g", "daemon off;"]