portfolio/docker/Dockerfile
2022-07-06 18:56:12 +02:00

27 lines
No EOL
488 B
Docker

# 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
COPY next.config.js next.config.js
RUN chown -R nextjs:nodejs .next
USER nextjs
EXPOSE 3000
ENV PORT 3000
CMD ["npm", "run", "start"]