2024-05-11 11:13:41 +00:00
|
|
|
# PHASE 1: copy and build
|
|
|
|
|
2024-05-24 06:33:28 +00:00
|
|
|
FROM node:22-alpine AS build
|
|
|
|
ENV NEXT_TELEMETRY_DISABLED 1
|
|
|
|
ENV NEXT_PRIVATE_STANDALONE true
|
2024-04-27 18:30:38 +00:00
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
COPY . .
|
2024-05-24 06:33:28 +00:00
|
|
|
RUN rm -rf node_modules && npm i --package-lock-only && npm ci
|
|
|
|
RUN npm run build
|
2024-05-11 11:13:41 +00:00
|
|
|
|
|
|
|
# PHASE 2: prepare for exec
|
2024-04-27 18:30:38 +00:00
|
|
|
|
2024-05-24 06:33:28 +00:00
|
|
|
FROM node:22-alpine AS exec
|
|
|
|
ENV NEXT_TELEMETRY_DISABLED 1
|
|
|
|
ENV NODE_ENV production
|
2024-05-11 11:13:41 +00:00
|
|
|
|
|
|
|
WORKDIR /app
|
2024-04-27 18:30:38 +00:00
|
|
|
|
2024-05-24 06:33:28 +00:00
|
|
|
COPY --from=build /app/.next/standalone .
|
|
|
|
COPY --from=build /app/.next/static ./.next/static
|
|
|
|
COPY --from=build /app/public ./public
|
2024-04-27 18:30:38 +00:00
|
|
|
|
|
|
|
EXPOSE 3000
|
|
|
|
|
2024-05-24 06:33:28 +00:00
|
|
|
ENTRYPOINT [ "node" ]
|
|
|
|
CMD ["server.js"]
|