FROM node:20-alpine AS builder WORKDIR /app # Install pnpm and configure registry RUN npm config set registry https://registry.npmmirror.com && \ npm install -g pnpm && \ pnpm config set registry https://registry.npmmirror.com # Copy workspace files COPY pnpm-workspace.yaml package.json pnpm-lock.yaml tsconfig.base.json ./ COPY packages/shared ./packages/shared COPY packages/client-screen ./packages/client-screen COPY packages/client-mobile ./packages/client-mobile # Install dependencies RUN pnpm install --frozen-lockfile # Build shared package WORKDIR /app/packages/shared RUN pnpm build # Build client-screen WORKDIR /app/packages/client-screen RUN pnpm build # Build client-mobile WORKDIR /app/packages/client-mobile RUN pnpm build # Production stage - Nginx FROM nginx:alpine # Copy built files COPY --from=builder /app/packages/client-screen/dist /usr/share/nginx/html/screen COPY --from=builder /app/packages/client-mobile/dist /usr/share/nginx/html/mobile # Copy nginx config COPY deploy/nginx.conf /etc/nginx/nginx.conf EXPOSE 80 443 CMD ["nginx", "-g", "daemon off;"]