-
Notifications
You must be signed in to change notification settings - Fork 316
[bug] Implement Multi-Stage Build in Dockerfile #814
Comments
Hey Hey! 👋🏻 Thank you so much for raising an issue. The maintainers will get back to you soon for discussion over the issue! In the meantime join our Discord server and checkout our YouTube channel. |
@AnuragThePathak Can I work on this issue? |
@SaptarshiSarkar12 go ahead |
@AnuragThePathak Thank you for assigning this issue to me 😁 |
@AnuragThePathak I have tried multiple approaches to add muti-stage docker build. But, My Dockerfile 👇 FROM node:17-alpine AS deps
COPY package.json ./
RUN npm install
FROM deps AS builder
COPY . .
RUN npm run build
FROM node:17-alpine AS runner
COPY --from=builder build ./build
RUN npm install -g serve
EXPOSE 3000
CMD ["serve", "-s", "build"] The error 👇 > start
> craco start
sh: 1: craco: not found |
@SaptarshiSarkar12 you should use package*.json then only package-lock.json will be copied |
@AnuragThePathak I was using |
Yes you must use |
@AnuragThePathak Okay. I have added. Please check #827 |
Describe the bug
The current Dockerfile lacks a multi-stage build. Adding this enhancement significantly reduces the image size, optimizes distribution, and simplifies container management.
To Reproduce
Go to Dockerfile
and add this
COPY package*.json ./
before this lineCOPY . .
Expected Behavior
No response
Screenshot/ Video
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: