Created
February 13, 2023 13:01
-
-
Save seiwonpark/1f97669fd733910b83f89e63abfd3ab4 to your computer and use it in GitHub Desktop.
react.Dockerfile
This file contains 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:16-alpine AS deps | |
WORKDIR /app | |
COPY package.json pnpm-lock.yaml ./ | |
RUN npm i -g pnpm && \ | |
pnpm i --frozen-lockfile | |
FROM node:16-alpine AS builder | |
WORKDIR /app | |
ENV NODE_ENV=production | |
COPY . ./ | |
COPY --from=deps /app/node_modules ./node_modules | |
RUN npm i -g pnpm && \ | |
pnpm run build | |
FROM node:16-alpine AS runner | |
WORKDIR /app | |
ENV NODE_ENV=production | |
COPY --from=builder /app/node_modules ./node_modules | |
COPY --from=builder /app/dist ./dist | |
CMD node dist/main.js | |
EXPOSE 3000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment