Created
August 9, 2024 23:35
-
-
Save mqnoy/c07d5d2a1bfee79afd80861e5bb25d5b to your computer and use it in GitHub Desktop.
NextJS 14 SSR + CSR Docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:20-alpine AS builder | |
RUN npm install -g pnpm | |
WORKDIR /app | |
COPY package.json pnpm-lock.yaml ./ | |
RUN pnpm install --frozen-lockfile --prod | |
COPY . . | |
RUN pnpm run build | |
FROM node:20-alpine AS runner | |
RUN npm install -g pnpm | |
WORKDIR /app | |
COPY --from=builder /app/node_modules ./node_modules | |
COPY --from=builder /app/package.json ./package.json | |
COPY --from=builder /app/.next ./.next | |
COPY --from=builder /app/public ./public | |
EXPOSE 3002 | |
CMD ["pnpm", "start"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment