Skip to content
This repository has been archived by the owner on Sep 7, 2024. It is now read-only.

feat: Added support for Multi-Stage Docker build #827

Merged
merged 6 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.git
.github
.gitignore
*.md
LICENSE
.husky
CNAME
node_modules
build
14 changes: 11 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
FROM --platform=linux/amd64 node:16-alpine
WORKDIR ./
FROM node:16-alpine AS deps
COPY package.json ./
RUN npm install

FROM deps AS builder
COPY . .
RUN npm run build

FROM node:16-alpine AS runner
COPY --from=builder build ./build
AnuragThePathak marked this conversation as resolved.
Show resolved Hide resolved
RUN npm install -g serve
EXPOSE 3000
CMD [ "npm", "start" ]
CMD ["serve", "-s", "build"]