Skip to content

Commit

Permalink
chore: optimize dockerfile (#62)
Browse files Browse the repository at this point in the history
* chore: optimize Dockerfile with cache layer

Signed-off-by: iutx <[email protected]>

* optimize command tips

Signed-off-by: iutx <[email protected]>

---------

Signed-off-by: iutx <[email protected]>
  • Loading branch information
iutx authored May 25, 2024
1 parent af0c997 commit 6c36303
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
FROM node:22-alpine as build-stage
# make the 'app' folder the current working directory
WORKDIR /app
# copy project files and folders to the current working directory (i.e. 'app' folder)
COPY . ./
# config node options
ENV NODE_OPTIONS=--max_old_space_size=8192
# config pnpm, install dependencies and build
# config pnpm, install dependencies
COPY package.json pnpm-lock.yaml* ./
RUN npm install [email protected] -g && \
pnpm install && \
pnpm build
pnpm install --frozen-lockfile
# copy project files and folders to the current working directory (i.e. 'app' folder)
COPY . ./
# build the project
RUN pnpm build
RUN echo "build successful 🎉 🎉 🎉"


Expand Down

0 comments on commit 6c36303

Please sign in to comment.