Skip to content

Commit

Permalink
fix: use prune to better support compiling binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
reednaa committed Mar 7, 2024
1 parent 196aa36 commit 165ccc3
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions dockerfile.relayer
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ WORKDIR /usr/catalyst-relayer
COPY package.json pnpm-lock.yaml tsconfig*.json ./
RUN corepack enable

# Install depends
FROM base AS prod-deps
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile --ignore-scripts

FROM base AS build
COPY abis ./abis
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod=false --frozen-lockfile
Expand All @@ -19,13 +15,15 @@ COPY src ./src
COPY drizzle ./drizzle
RUN pnpm run build

RUN pnpm prune --prod --config.ignore-scripts=true

## Production image
FROM node:18-alpine

WORKDIR /usr/catalyst-relayer

COPY --from=build /usr/catalyst-relayer/dist ./dist
COPY --from=prod-deps /usr/catalyst-relayer/node_modules ./node_modules
COPY --from=build /usr/catalyst-relayer/node_modules ./node_modules

COPY --from=build /usr/catalyst-relayer/drizzle ./drizzle

Expand Down

0 comments on commit 165ccc3

Please sign in to comment.