2022-01-01 20:42:25 +01:00
|
|
|
FROM node:16.13.1 AS dependencies
|
2021-10-24 05:48:06 +02:00
|
|
|
WORKDIR /usr/src/app
|
2021-10-24 05:19:39 +02:00
|
|
|
COPY ./package*.json ./
|
2022-01-07 21:21:38 +01:00
|
|
|
RUN npm install
|
2021-10-24 05:48:06 +02:00
|
|
|
|
2022-01-01 20:42:25 +01:00
|
|
|
FROM node:16.13.1 AS builder
|
2021-10-24 05:48:06 +02:00
|
|
|
WORKDIR /usr/src/app
|
2021-10-24 05:19:39 +02:00
|
|
|
COPY ./ ./
|
2021-10-24 05:48:06 +02:00
|
|
|
COPY --from=dependencies /usr/src/app/node_modules ./node_modules
|
|
|
|
RUN npm run build
|
2021-10-24 05:19:39 +02:00
|
|
|
|
2022-01-01 20:42:25 +01:00
|
|
|
FROM node:16.13.1 AS runner
|
2021-10-24 05:48:06 +02:00
|
|
|
WORKDIR /usr/src/app
|
|
|
|
ENV NODE_ENV=production
|
|
|
|
COPY --from=builder /usr/src/app/next.config.js ./next.config.js
|
|
|
|
COPY --from=builder /usr/src/app/public ./public
|
|
|
|
COPY --from=builder /usr/src/app/.next ./.next
|
|
|
|
COPY --from=builder /usr/src/app/i18n.json ./i18n.json
|
|
|
|
COPY --from=builder /usr/src/app/locales ./locales
|
|
|
|
COPY --from=builder /usr/src/app/pages ./pages
|
|
|
|
COPY --from=builder /usr/src/app/node_modules ./node_modules
|
|
|
|
RUN npx next telemetry disable
|
|
|
|
CMD ["node_modules/.bin/next", "start", "--port", "${PORT}"]
|