Skip to content

Commit

Permalink
fix: Docker build
Browse files Browse the repository at this point in the history
Signed-off-by: Jawad Tariq <[email protected]>
  • Loading branch information
JDawg287 committed Mar 14, 2024
1 parent b0ff4b0 commit fe18fa9
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 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 @@ -8,11 +20,15 @@ ARG SCCACHE_BUCKET
ARG SCCACHE_REGION
ARG RUSTC_WRAPPER
ARG PROTOC_VERSION=22.2
ARG SKIP_CONTRACT_BUILD=true

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 fe18fa9

Please sign in to comment.