2022-07-06 16:19:59 +02:00
|
|
|
# Install dependencies only when needed
|
|
|
|
FROM node:16-alpine
|
|
|
|
RUN apk add --no-cache libc6-compat
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
ENV NODE_ENV production
|
|
|
|
ENV NEXT_TELEMETRY_DISABLED 1
|
|
|
|
|
|
|
|
RUN addgroup --system --gid 1001 nodejs
|
|
|
|
RUN adduser --system --uid 1001 nextjs
|
|
|
|
|
|
|
|
COPY .next/ .next/
|
|
|
|
COPY public/ public/
|
|
|
|
COPY node_modules/ node_modules/
|
|
|
|
COPY package.json package.json
|
|
|
|
|
|
|
|
RUN chown -R nextjs:nodejs .next
|
|
|
|
|
|
|
|
USER nextjs
|
|
|
|
|
|
|
|
EXPOSE 3000
|
|
|
|
|
|
|
|
ENV PORT 3000
|
|
|
|
|
2022-07-06 18:31:17 +02:00
|
|
|
CMD ["npm", "run", "start"]
|