2024-07-20 10:21:16 +02:00
|
|
|
FROM node:20.15.1 AS builder-dependencies
|
2023-01-10 23:56:46 +01:00
|
|
|
WORKDIR /usr/src/application
|
2021-06-13 00:30:02 +02:00
|
|
|
COPY ./package*.json ./
|
2023-05-13 19:09:54 +02:00
|
|
|
RUN npm clean-install
|
2021-04-18 01:56:23 +02:00
|
|
|
|
2024-07-20 10:21:16 +02:00
|
|
|
FROM node:20.15.1 AS builder
|
2023-12-28 06:21:24 +01:00
|
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
|
|
ENV IS_STANDALONE=true
|
2023-01-10 23:56:46 +01:00
|
|
|
WORKDIR /usr/src/application
|
|
|
|
COPY --from=builder-dependencies /usr/src/application/node_modules ./node_modules
|
2021-06-13 00:30:02 +02:00
|
|
|
COPY ./ ./
|
2021-05-08 19:52:04 +02:00
|
|
|
RUN npm run build
|
2021-06-13 00:30:02 +02:00
|
|
|
|
2024-07-20 10:21:16 +02:00
|
|
|
FROM node:20.15.1-slim AS runner
|
2021-06-13 00:30:02 +02:00
|
|
|
ENV NODE_ENV=production
|
2023-08-24 22:38:09 +02:00
|
|
|
ENV HOSTNAME=0.0.0.0
|
2022-10-03 20:52:15 +02:00
|
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
2023-12-28 06:21:24 +01:00
|
|
|
ENV IS_STANDALONE=true
|
|
|
|
WORKDIR /usr/src/application
|
|
|
|
RUN addgroup --system --gid 1001 nodejs && adduser --system --uid 1001 applicationrunner
|
|
|
|
USER applicationrunner
|
|
|
|
COPY --from=builder-dependencies --chown=applicationrunner:nodejs /usr/src/application/node_modules ./node_modules
|
|
|
|
COPY --from=builder --chown=applicationrunner:nodejs /usr/src/application/.next/standalone ./
|
|
|
|
COPY --from=builder --chown=applicationrunner:nodejs /usr/src/application/.next/static ./.next/static
|
|
|
|
COPY --from=builder --chown=applicationrunner:nodejs /usr/src/application/public ./public
|
|
|
|
COPY --from=builder --chown=applicationrunner:nodejs /usr/src/application/i18n/translations ./i18n/translations
|
|
|
|
COPY --from=builder --chown=applicationrunner:nodejs /usr/src/application/next.config.js ./next.config.js
|
2023-01-10 23:56:46 +01:00
|
|
|
CMD ["./server.js"]
|