ipv6-test-frontend/Dockerfile

33 lines
680 B
Docker
Raw Permalink Normal View History

2024-08-17 23:22:36 +08:00
FROM node:20-alpine AS build-stage
2024-08-16 23:32:19 +08:00
WORKDIR /app
RUN corepack enable
2024-08-16 23:41:27 +08:00
COPY package.json pnpm-lock.yaml ./
2024-08-16 23:32:19 +08:00
RUN --mount=type=cache,id=pnpm-store,target=/root/.pnpm-store \
pnpm install --frozen-lockfile
COPY . .
RUN pnpm build
2024-08-17 23:22:36 +08:00
FROM node:20-alpine AS production-stage
2024-08-16 23:32:19 +08:00
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
2024-08-16 23:53:10 +08:00
CMD ["node", "server.js"]