# Trouve-KA — image web Next.js # Author: Simon-Pierre Boucher # Contact: contact@spboucher.ai FROM node:22-alpine AS builder WORKDIR /repo RUN corepack enable COPY package.json pnpm-workspace.yaml ./ COPY apps/web/package.json apps/web/ # sharp et unrs-resolver ont des scripts de build napi légitimes requis par Next RUN pnpm install --frozen-lockfile=false --dangerously-allow-all-builds COPY apps/web apps/web # Les rewrites Next.js sont compilés au build : l'URL interne de l'API doit être fixée ici ARG API_URL=http://api:8080 ENV API_URL=${API_URL} RUN pnpm --filter @trouveka/web build FROM node:22-alpine WORKDIR /repo RUN corepack enable ENV NODE_ENV=production COPY --from=builder /repo/package.json /repo/pnpm-workspace.yaml ./ COPY --from=builder /repo/node_modules ./node_modules COPY --from=builder /repo/apps/web ./apps/web EXPOSE 3000 CMD ["pnpm", "--filter", "@trouveka/web", "start"]