项目初始化

This commit is contained in:
Stev_Wang
2025-12-22 23:51:21 +08:00
commit 4a97b964ac
64 changed files with 8371 additions and 0 deletions

33
frontend/Dockerfile Normal file
View File

@@ -0,0 +1,33 @@
# 多阶段构建:构建阶段
FROM node:18-alpine AS build-stage
WORKDIR /app
# 设置国内镜像源以加速依赖安装(可选,根据实际情况调整)
# RUN npm config set registry https://registry.npmmirror.com
# 复制package.json和package-lock.json
COPY package*.json ./
# 安装依赖
RUN npm ci
# 复制源代码
COPY . .
# 构建应用
RUN npm run build
# 多阶段构建:运行阶段
FROM nginx:1.23-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
# 暴露端口
EXPOSE 80
# 启动Nginx
CMD ["nginx", "-g", "daemon off;"]