277a484f60
- Add UAT PocketBase on port 8712 with separate pb_data_uat - Add UAT nginx config proxying to UAT PB (port 8712) - Update Dockerfile to support NGINX_CONF build arg - Add .gitignore for .playwright-mcp/ - Auto-generated team_sessions migration Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
32 lines
581 B
Docker
32 lines
581 B
Docker
# 构建阶段
|
|
FROM node:20-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# 复制 package 文件
|
|
COPY package*.json ./
|
|
RUN npm ci
|
|
|
|
# 复制源码
|
|
COPY . .
|
|
|
|
# 设置构建参数并构建(默认使用相对路径,由 nginx 代理)
|
|
ARG VITE_PB_URL=
|
|
ENV VITE_PB_URL=$VITE_PB_URL
|
|
|
|
RUN npm run build
|
|
|
|
# 生产阶段
|
|
FROM nginx:alpine
|
|
|
|
# 复制构建产物
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
|
|
# 通过 NGINX_CONF 参数选择配置文件(默认 dev)
|
|
ARG NGINX_CONF=nginx.conf
|
|
COPY ${NGINX_CONF} /etc/nginx/conf.d/default.conf
|
|
|
|
EXPOSE 80
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|