Files
sarlinkportal/.build/prod/frontend.Dockerfile
T
2026-08-02 05:09:00 +05:00

28 lines
660 B
Docker

FROM node:22-slim AS builder
WORKDIR /var/www/html
ENV NEXT_TELEMETRY_DISABLED=1
COPY frontend/package.json frontend/package-lock.json ./
RUN npm ci --legacy-peer-deps
COPY frontend/ .
RUN npm run build
# ---- runtime ----
# next.config.ts sets `output: "standalone"`, so we ship only the traced server.
FROM node:22-slim AS runner
WORKDIR /var/www/html
ENV NODE_ENV=production \
NEXT_TELEMETRY_DISABLED=1 \
HOSTNAME=0.0.0.0 \
PORT=3000
COPY --from=builder /var/www/html/public ./public
COPY --from=builder /var/www/html/.next/standalone ./
COPY --from=builder /var/www/html/.next/static ./.next/static
EXPOSE 3000
CMD ["node", "server.js"]