Skip to content

Commit

Permalink
chore: reduced ccip-gateway image size + remove dist folder from repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Julink-eth committed Nov 25, 2024
1 parent d214ce6 commit 7ce1d08
Show file tree
Hide file tree
Showing 28 changed files with 686 additions and 1,214 deletions.
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
44 changes: 35 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,26 @@ 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 compile
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

WORKDIR /usr/src/app

RUN pnpm install --filter ./packages/linea-state-verifier
RUN pnpm install --filter ./packages/linea-ccip-gateway
ENV NODE_ENV=production

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

0 comments on commit 7ce1d08

Please sign in to comment.