Skip to content

Commit

Permalink
⚡ reduce docker image size with multistage builds
Browse files Browse the repository at this point in the history
  • Loading branch information
andresribeiro committed Dec 31, 2022
1 parent 702e7ad commit 8457c1b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:buster-slim
FROM node:buster-slim as builder

WORKDIR /usr/app

Expand All @@ -17,6 +17,20 @@ COPY . .

RUN yarn build

FROM node:buster-slim

WORKDIR /app

RUN apt-get update && \
apt-get install -y build-essential \
wget \
python3 \
make \
gcc \
libc6-dev

COPY --from=builder /usr/app /app/

EXPOSE 3333

CMD ["yarn", "start"]

0 comments on commit 8457c1b

Please sign in to comment.