FROM node:20-slim AS builder WORKDIR /app COPY frontend/package*.json ./ RUN npm install --legacy-peer-deps COPY frontend/ ./ ARG NEXT_PUBLIC_API_URL=http://localhost:8000 ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL} RUN npm run build # ── Runtime ──────────────────────────────────────────────────────────────────── FROM node:20-slim WORKDIR /app COPY --from=builder /app/.next/standalone ./ COPY --from=builder /app/.next/static ./.next/static COPY --from=builder /app/public ./public EXPOSE 3000 ENV PORT=3000 ENV HOSTNAME=0.0.0.0 CMD ["node", "server.js"]