2023-12-28 21:58:08 +00:00
|
|
|
FROM node:18-alpine3.19
|
2023-09-09 16:55:38 +02:00
|
|
|
|
2023-12-28 21:58:08 +00:00
|
|
|
RUN apk add --no-cache libc6-compat
|
2023-09-09 16:55:38 +02:00
|
|
|
|
2023-12-28 21:58:08 +00:00
|
|
|
WORKDIR /app
|
2023-09-09 16:55:38 +02:00
|
|
|
|
2023-12-28 21:58:08 +00:00
|
|
|
ENV NODE_ENV production
|
|
|
|
ENV PORT 3000
|
2023-09-09 16:55:38 +02:00
|
|
|
|
2023-12-28 21:58:08 +00:00
|
|
|
ENV NEXT_TELEMETRY_DISABLED 1
|
|
|
|
|
|
|
|
RUN addgroup --system --gid 1001 nodejs \
|
|
|
|
&& adduser --system --uid 1001 nextjs
|
|
|
|
|
|
|
|
COPY .next/ .next/
|
|
|
|
COPY public/ public/
|
|
|
|
COPY node_modules/ node_modules/
|
|
|
|
COPY package.json package.json
|
|
|
|
COPY next.config.js next.config.js
|
|
|
|
|
|
|
|
RUN chown -R nextjs:nodejs .next
|
|
|
|
|
|
|
|
USER nextjs
|
|
|
|
|
|
|
|
EXPOSE 3000
|
|
|
|
|
|
|
|
CMD ["npm", "run", "start"]
|