前端项目初始化,登录页支持暗色主题与禁止滑动
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
28
frontend/docker/Dockerfile
Normal file
28
frontend/docker/Dockerfile
Normal file
@@ -0,0 +1,28 @@
|
||||
# 生产环境 Dockerfile — 多阶段构建
|
||||
# Stage 1: 构建
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json package-lock.json* ./
|
||||
RUN npm ci
|
||||
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
# Stage 2: 运行
|
||||
FROM nginx:1.25-alpine
|
||||
|
||||
# 复制自定义 Nginx 配置
|
||||
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
# 复制构建产物
|
||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||
|
||||
# 健康检查
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||
CMD wget --quiet --tries=1 --spider http://localhost:80/ || exit 1
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
Reference in New Issue
Block a user