feat: rollback cargo-chef usage
This commit is contained in:
@@ -4,50 +4,19 @@ WORKDIR /app
|
|||||||
RUN cargo install cargo-chef
|
RUN cargo install cargo-chef
|
||||||
|
|
||||||
# =========== Tycho Indexer ===========
|
# =========== Tycho Indexer ===========
|
||||||
# Stage 1: Prepare tycho-indexer dependencies
|
# Stage 1: Build tycho-indexer
|
||||||
FROM rust:1.89-bookworm AS tycho-indexer-prepare
|
|
||||||
WORKDIR /build/tycho-indexer
|
|
||||||
RUN apt-get update && apt-get install -y git
|
|
||||||
RUN git clone --depth 1 --branch "0.83.4" https://github.com/propeller-heads/tycho-indexer.git .
|
|
||||||
COPY --from=cargo-chef /usr/local/cargo/bin/cargo-chef /usr/local/cargo/bin/cargo-chef
|
|
||||||
RUN cargo chef prepare --recipe-path recipe.json
|
|
||||||
|
|
||||||
# Stage 2: Cook tycho-indexer dependencies
|
|
||||||
FROM rust:1.89-bookworm AS tycho-indexer-cook
|
|
||||||
WORKDIR /build/tycho-indexer
|
|
||||||
COPY --from=tycho-indexer-prepare /build/tycho-indexer/ ./
|
|
||||||
COPY --from=cargo-chef /usr/local/cargo/bin/cargo-chef /usr/local/cargo/bin/cargo-chef
|
|
||||||
RUN cargo chef cook --release --recipe-path recipe.json
|
|
||||||
|
|
||||||
# Stage 3: Build tycho-indexer
|
|
||||||
FROM rust:1.89-bookworm AS tycho-indexer-builder
|
FROM rust:1.89-bookworm AS tycho-indexer-builder
|
||||||
|
WORKDIR /build
|
||||||
|
RUN apt-get update && apt-get install -y git
|
||||||
|
RUN git clone --depth 1 --branch "0.83.4" https://github.com/propeller-heads/tycho-indexer.git
|
||||||
WORKDIR /build/tycho-indexer
|
WORKDIR /build/tycho-indexer
|
||||||
COPY --from=tycho-indexer-cook /build/tycho-indexer/ ./
|
|
||||||
COPY --from=cargo-chef /usr/local/cargo/bin/cargo-chef /usr/local/cargo/bin/cargo-chef
|
|
||||||
RUN cargo build --release --bin tycho-indexer
|
RUN cargo build --release --bin tycho-indexer
|
||||||
|
|
||||||
# =========== Protocol SDK ===========
|
# =========== Protocol SDK ===========
|
||||||
# Stage 1: Prepare protocol-sdk dependencies
|
# Stage 1: Build protocol-sdk
|
||||||
FROM rust:1.89-bookworm AS protocol-sdk-prepare
|
|
||||||
WORKDIR /build/tycho-protocol-sdk
|
|
||||||
COPY . .
|
|
||||||
COPY --from=cargo-chef /usr/local/cargo/bin/cargo-chef /usr/local/cargo/bin/cargo-chef
|
|
||||||
WORKDIR /build/tycho-protocol-sdk/protocol-testing
|
|
||||||
RUN cargo chef prepare --recipe-path recipe.json
|
|
||||||
|
|
||||||
# Stage 2: Cook protocol-sdk dependencies
|
|
||||||
FROM rust:1.89-bookworm AS protocol-sdk-cook
|
|
||||||
WORKDIR /build/tycho-protocol-sdk
|
|
||||||
COPY --from=protocol-sdk-prepare /build/tycho-protocol-sdk/ ./
|
|
||||||
COPY --from=cargo-chef /usr/local/cargo/bin/cargo-chef /usr/local/cargo/bin/cargo-chef
|
|
||||||
WORKDIR /build/tycho-protocol-sdk/protocol-testing
|
|
||||||
RUN cargo chef cook --release --recipe-path recipe.json
|
|
||||||
|
|
||||||
# Stage 3: Build protocol-sdk
|
|
||||||
FROM rust:1.89-bookworm AS protocol-sdk-builder
|
FROM rust:1.89-bookworm AS protocol-sdk-builder
|
||||||
WORKDIR /build/tycho-protocol-sdk
|
WORKDIR /build/tycho-protocol-sdk
|
||||||
COPY --from=protocol-sdk-cook /build/tycho-protocol-sdk/ ./
|
COPY . .
|
||||||
COPY --from=cargo-chef /usr/local/cargo/bin/cargo-chef /usr/local/cargo/bin/cargo-chef
|
|
||||||
WORKDIR /build/tycho-protocol-sdk/protocol-testing
|
WORKDIR /build/tycho-protocol-sdk/protocol-testing
|
||||||
RUN cargo build --release
|
RUN cargo build --release
|
||||||
|
|
||||||
@@ -76,9 +45,7 @@ RUN apt-get update && apt-get install -y ca-certificates libssl-dev libpq-dev
|
|||||||
|
|
||||||
# Copy binaries from previous stages
|
# Copy binaries from previous stages
|
||||||
COPY --from=tycho-indexer-builder /build/tycho-indexer/target/release/tycho-indexer /usr/local/bin/tycho-indexer
|
COPY --from=tycho-indexer-builder /build/tycho-indexer/target/release/tycho-indexer /usr/local/bin/tycho-indexer
|
||||||
RUN chmod +x /usr/local/bin/tycho-indexer
|
|
||||||
COPY --from=protocol-sdk-builder /build/tycho-protocol-sdk/protocol-testing/target/release/protocol-testing /usr/local/bin/tycho-protocol-sdk
|
COPY --from=protocol-sdk-builder /build/tycho-protocol-sdk/protocol-testing/target/release/protocol-testing /usr/local/bin/tycho-protocol-sdk
|
||||||
RUN chmod +x /usr/local/bin/tycho-protocol-sdk
|
|
||||||
COPY --from=protocol-sdk-builder /build/tycho-protocol-sdk/protocol-testing/entrypoint.sh /entrypoint.sh
|
COPY --from=protocol-sdk-builder /build/tycho-protocol-sdk/protocol-testing/entrypoint.sh /entrypoint.sh
|
||||||
RUN chmod +x /entrypoint.sh
|
RUN chmod +x /entrypoint.sh
|
||||||
COPY --from=protocol-sdk-builder /build/tycho-protocol-sdk/substreams /app/substreams
|
COPY --from=protocol-sdk-builder /build/tycho-protocol-sdk/substreams /app/substreams
|
||||||
|
|||||||
Reference in New Issue
Block a user