26 lines
451 B
Text
26 lines
451 B
Text
![]() |
# 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
|
||
|
|
||
|
CMD ["node", "server.js"]
|