Create Dockerfile

This commit is contained in:
tuna2134@コマリン親衛隊
2025-04-28 13:23:49 +09:00
committed by GitHub
parent 7b9d1b172e
commit 5b79428f53

25
Dockerfile Normal file
View File

@@ -0,0 +1,25 @@
FROM node:22-slim as builder
WORKDIR /src
ENV OUTPUT standalone
RUN corepack enable
COPY pnpm-lock.yaml package.json .
RUN pnpm install --frozen-lockfile
COPY . .
RUN pnpm build
FROM gcr.io/distroless/nodejs22-debian12
ENV NODE_ENV production
WORKDIR /usr/src
COPY --chown=nonroot:nonroot ./public ./public
COPY --from=builder --chown=nonroot:nonroot /src/.next/standalone ./
COPY --from=builder --chown=nonroot:nonroot /src/.next/static ./.next/static
USER nonroot
EXPOSE 3000
CMD ["server.js"]