Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
berviantoleo authored Nov 24, 2024
1 parent 1bab339 commit 5086fcf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
FROM node:22-alpine as build
# Create app directory
WORKDIR /app
COPY package.json yarn.lock .yarnrc.yml ./
RUN apk add --no-cache git && corepack enable && yarn install --immutable
COPY . .
RUN apk add --no-cache git && corepack enable && yarn install --immutable && yarn build
RUN yarn build

FROM node:22-alpine as runner
WORKDIR /app
COPY --from=build /app/lib /app/lib
COPY package.json yarn.lock ./
COPY package.json yarn.lock .yarnrc.yml ./
RUN corepack enable && yarn install --immutable --production && yarn cache clean
RUN adduser -D ia && chown -R ia /app
USER ia
Expand Down

0 comments on commit 5086fcf

Please sign in to comment.