# Dependencies stage FROM node:26-alpine AS deps WORKDIR /app COPY package.json package-lock.json* ./ RUN npm install # Build stage FROM node:26-alpine AS builder WORKDIR /app COPY --from=deps /app/node_modules ./node_modules COPY . . # Baked in at build time: NEXT_PUBLIC_* values are inlined into the client # bundle. SITE_API is the browser-reachable URL of sitesvc, which serves both # forms. It is effectively required: leave it empty and both forms report they # are not connected rather than submitting anywhere. Must be an origin the # browser can reach (not the internal sitesvc:8082) and be listed in sitesvc's # SITE_ORIGIN for CORS. ARG NEXT_PUBLIC_SITE_API="" ARG NEXT_PUBLIC_CONTACT_EMAIL="support@hostxtra.co.uk" # Browser-reachable admin URL; site/lib/submit.ts posts account signups here. ARG NEXT_PUBLIC_ADMIN_API_URL="" ENV NEXT_PUBLIC_SITE_API=$NEXT_PUBLIC_SITE_API ENV NEXT_PUBLIC_CONTACT_EMAIL=$NEXT_PUBLIC_CONTACT_EMAIL ENV NEXT_PUBLIC_ADMIN_API_URL=$NEXT_PUBLIC_ADMIN_API_URL RUN npm run build # Runtime stage FROM node:26-alpine AS runner WORKDIR /app ENV NODE_ENV=production ENV NEXT_TELEMETRY_DISABLED=1 RUN addgroup --system --gid 1001 nodejs && \ adduser --system --uid 1001 nextjs COPY --from=builder /app/public ./public COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static USER nextjs EXPOSE 3000 ENV PORT=3000 ENV HOSTNAME="0.0.0.0" CMD ["node", "server.js"]