Files
gamegroup2/frontend/Dockerfile
T
congsh 2ce8985747 feat: add GameGroup2 project with frontend and backend
- Add .gitignore for Node.js and PocketBase projects
- Add frontend (Vue 3 + Vite + TypeScript)
- Add backend (PocketBase)
- Add deployment scripts and Docker compose configs

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 15:45:54 +08:00

31 lines
517 B
Docker

# 构建阶段
FROM node:20-alpine AS builder
WORKDIR /app
# 复制 package 文件
COPY package*.json ./
RUN npm ci
# 复制源码
COPY . .
# 设置构建参数并构建(默认使用相对路径,由 nginx 代理)
ARG VITE_PB_URL=/api
ENV VITE_PB_URL=$VITE_PB_URL
RUN npm run build
# 生产阶段
FROM nginx:alpine
# 复制构建产物
COPY --from=builder /app/dist /usr/share/nginx/html
# 复制 nginx 配置
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]