# Stage 1: Build with pnpm FROM node:20-alpine AS builder WORKDIR /app # Install pnpm globally RUN corepack enable && corepack prepare pnpm@latest --activate COPY package.json pnpm-lock.yaml ./ RUN pnpm install COPY . . RUN pnpm build # Stage 2: Serve with nginx FROM nginx:alpine # Copy built files to nginx's web directory COPY --from=builder /app/dist /usr/share/nginx/html # Expose port 3087 EXPOSE 3087 # Change default nginx config to use port 3087 RUN sed -i 's/80;/3087;/' /etc/nginx/conf.d/default.conf