Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
chore: unify docker images
Browse files Browse the repository at this point in the history
Signed-off-by: Jawad Tariq <[email protected]>
  • Loading branch information
JDawg287 committed Mar 13, 2024
1 parent a01e135 commit b469dfe
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,12 @@
!tools/config/nextest.toml
!.git

# Allow contract related code
!contracts/contracts/**/*
!contracts/hardhat.config.ts
!contracts/package*.json
!contracts/scripts/**/*
!contracts/tsconfig.json
!contracts/typechain-types/**/*

!LICENSE
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
ARG RUSTUP_TOOLCHAIN=stable

FROM node:18.15.0-slim as topos-contracts

WORKDIR /usr/src/app

COPY ./contracts/package*.json .
RUN npm install

COPY ./contracts .

RUN npm run build

FROM --platform=${BUILDPLATFORM:-linux/amd64} ghcr.io/topos-protocol/rust_builder:bullseye-${RUSTUP_TOOLCHAIN} AS base

ARG FEATURES
Expand All @@ -13,6 +25,9 @@ WORKDIR /usr/src/app

FROM --platform=${BUILDPLATFORM:-linux/amd64} base AS build
COPY . .

COPY --from=topos-contracts /usr/src/app/artifacts ./contracts/artifacts

RUN --mount=type=secret,id=aws,target=/root/.aws/credentials \
--mount=type=cache,id=sccache,target=/root/.cache/sccache \
cargo build --release --no-default-features --features=${FEATURES} \
Expand Down

0 comments on commit b469dfe

Please sign in to comment.