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

chore: reduced ccip-gateway image size + remove dist folder from repo #255

Merged
merged 5 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
1 change: 1 addition & 0 deletions packages/linea-ccip-gateway/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pids
*.pid
*.seed
*.pid.lock
dist

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
Expand Down
41 changes: 32 additions & 9 deletions packages/linea-ccip-gateway/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
FROM node:18
FROM node:20-slim AS base

ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"

RUN corepack enable

RUN apt-get update && apt-get install -y \
python3 \
make \
g++ \
gcc \
build-essential \
libcairo2-dev \
libpango1.0-dev \
libjpeg-dev \
libgif-dev \
librsvg2-dev \
&& rm -rf /var/lib/apt/lists/*

FROM base AS build

WORKDIR /app

Expand All @@ -15,20 +35,23 @@ ENV L2_CHAIN_ID=$L2_CHAIN_ID
ENV NODE_ENV=$NODE_ENV

COPY packages/linea-ccip-gateway ./packages/linea-ccip-gateway
COPY packages/linea-state-verifier ./packages/linea-state-verifier
COPY pnpm-lock.yaml ./pnpm-lock.yaml
COPY pnpm-workspace.yaml ./pnpm-workspace.yaml

RUN npm install -g pnpm
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile --prefer-offline

RUN pnpm run --filter=./packages/linea-ccip-gateway build

RUN pnpm deploy --filter=./packages/linea-ccip-gateway --prod /prod/linea-ccip-gateway

FROM node:20-slim AS production

RUN pnpm install --filter ./packages/linea-state-verifier
RUN pnpm install --filter ./packages/linea-ccip-gateway
WORKDIR /usr/src/app

WORKDIR /app/packages/linea-ccip-gateway
USER node

RUN pnpm compile
RUN pnpm build
COPY --from=build /prod/linea-ccip-gateway .

EXPOSE 3000

CMD ["pnpm", "start"]
CMD [ "node", "./dist/server.js" ]
41 changes: 0 additions & 41 deletions packages/linea-ccip-gateway/dist/L2ProofService.d.ts

This file was deleted.

137 changes: 0 additions & 137 deletions packages/linea-ccip-gateway/dist/L2ProofService.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/linea-ccip-gateway/dist/L2ProofService.js.map

This file was deleted.

33 changes: 0 additions & 33 deletions packages/linea-ccip-gateway/dist/evm-gateway/EVMGateway.d.ts

This file was deleted.

Loading
Loading