33 lines
680 B
Docker
33 lines
680 B
Docker
FROM node:20-alpine AS build-stage
|
|
|
|
WORKDIR /app
|
|
RUN corepack enable
|
|
|
|
COPY package.json pnpm-lock.yaml ./
|
|
RUN --mount=type=cache,id=pnpm-store,target=/root/.pnpm-store \
|
|
pnpm install --frozen-lockfile
|
|
|
|
COPY . .
|
|
RUN pnpm build
|
|
|
|
FROM node:20-alpine AS production-stage
|
|
WORKDIR /srv/ipv6-test
|
|
|
|
ENV NODE_ENV production
|
|
|
|
RUN addgroup --system --gid 1001 nodejs
|
|
RUN adduser --system --uid 1001 nextjs
|
|
|
|
COPY --from=build-stage /app/public ./public
|
|
|
|
COPY --from=build-stage --chown=nextjs:nodejs /app/.next/standalone ./
|
|
COPY --from=build-stage --chown=nextjs:nodejs /app/.next/static ./.next/static
|
|
|
|
RUN chown nextjs:nodejs .next
|
|
|
|
USER nextjs
|
|
|
|
EXPOSE 3000
|
|
|
|
CMD ["node", "server.js"]
|