content: FROM node:18-alpine AS base
  RUN apk add --no-cache libc6-compat
  RUN apk update
  
  ENV PNPM_HOME="/pnpm"
  ENV PATH="$PNPM_HOME:$PATH"
  RUN corepack enable
  
  FROM base AS pruner
  WORKDIR /app
  RUN pnpm config set registry https://registry.npmmirror.com && pnpm add -g turbo
  COPY . .
  RUN turbo prune --scope=web --docker
  
  FROM base AS builder
  WORKDIR /app
  
  COPY --from=pruner /app/out/json/ .
  COPY --from=pruner /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
  RUN pnpm config set registry https://registry.npmmirror.com && pnpm install --frozen-lockfile --ignore-scripts
  
  COPY --from=pruner /app/out/full/ .
  COPY turbo.json turbo.json
  
  COPY .env apps/web/.env
  
  RUN pnpm turbo build --filter=web
  
  FROM base AS runner
  WORKDIR /app
  
  
  RUN addgroup --system --gid 1001 nodejs
  RUN adduser --system --uid 1001 nextjs
  
  COPY --from=builder /app/apps/web/next.config.js ./
  COPY --from=builder /app/apps/web/package.json ./package.json
  
  COPY --from=builder --chown=nextjs:nodejs /app/apps/web/.next/standalone ./
  COPY --from=builder --chown=nextjs:nodejs /app/apps/web/.next/static ./apps/web/.next/static
  COPY --from=builder --chown=nextjs:nodejs /app/apps/web/public ./apps/web/public
  
  USER nextjs
  
  EXPOSE 2088
  
  ENV PORT 2088
  ENV HOSTNAME "0.0.0.0"
  
  CMD ["node", "apps/web/server.js"]
  