Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use pnpm instead of yarn #3

Merged
merged 6 commits into from
Mar 7, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat: use pnpm to build
  • Loading branch information
reednaa committed Mar 7, 2024
commit 8a243414ee78ad2c64402de4c7c032c6a83cc129
29 changes: 17 additions & 12 deletions dockerfile.relayer
Original file line number Diff line number Diff line change
@@ -1,30 +1,35 @@
FROM node:18 AS BUILD_IMAGE
FROM node:18 AS base

WORKDIR /usr/catalyst-relayer

# Copy packages and install
COPY package.json yarn.lock tsconfig*.json ./
# Copy packages
COPY package.json pnpm-lock.yaml tsconfig*.json ./
COPY abis ./abis
RUN yarn install --frozen-lockfile --prod=false
COPY src ./src
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
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod=false --frozen-lockfile
RUN pnpm run build

# Copy src and build
COPY src ./src
COPY drizzle ./drizzle
RUN yarn build

# Remove devDependencies
RUN npm prune --omit=dev


# Production image
## Production image
FROM node:18-alpine

WORKDIR /usr/catalyst-relayer

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

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

ENV NODE_ENV=${NODE_ENV}

Loading