创赢未来评分系统 - 初始化提交(移除大文件)
All checks were successful
Deploy to Server / deploy (push) Successful in 18s
All checks were successful
Deploy to Server / deploy (push) Successful in 18s
This commit is contained in:
29
frontend/Dockerfile
Normal file
29
frontend/Dockerfile
Normal file
@@ -0,0 +1,29 @@
|
||||
# Use an official Node runtime as a parent image
|
||||
FROM node:22-alpine
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Install build dependencies for native modules
|
||||
RUN apk add --no-cache autoconf automake libtool make g++ zlib-dev nasm python3
|
||||
|
||||
# Install dependencies
|
||||
COPY package.json package-lock.json* ./
|
||||
RUN npm install --registry=https://registry.npmmirror.com
|
||||
|
||||
# 复制项目文件
|
||||
COPY . .
|
||||
|
||||
# 接收构建参数
|
||||
ARG VITE_API_URL=/api
|
||||
# 设置环境变量供构建时使用
|
||||
ENV VITE_API_URL=$VITE_API_URL
|
||||
|
||||
# 构建生产环境代码
|
||||
RUN npm run build
|
||||
|
||||
# 暴露应用运行的端口
|
||||
EXPOSE 15173
|
||||
|
||||
# 启动应用 (Preview 模式)
|
||||
CMD ["npm", "run", "preview", "--", "--host", "0.0.0.0", "--port", "15173"]
|
||||
Reference in New Issue
Block a user