forked from propeller-heads/tycho
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (28 loc) · 1.26 KB
/
Dockerfile
File metadata and controls
31 lines (28 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM rust:1.91-bookworm AS chef
ARG TARGETPLATFORM=linux/amd64
WORKDIR /build
RUN apt-get update && apt-get install -y libpq-dev jq
RUN ARCH=$(echo $TARGETPLATFORM | sed -e 's/\//_/g') && \
if [ "$ARCH" = "linux_amd64" ]; then \
ARCH="linux_x86_64"; \
fi && \
LINK=$(curl -s https://api.github.com/repos/streamingfast/substreams/releases/latest | jq -r ".assets[] | select(.name | contains(\"$ARCH\")) | .browser_download_url") && \
echo ARCH: $ARCH, LINK: $LINK && \
curl -L $LINK | tar zxf - -C /usr/local/bin/
RUN cargo install cargo-chef
COPY rust-toolchain.toml .
RUN rustup set profile minimal && rustup install
FROM chef AS planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS build
COPY --from=planner /build/recipe.json recipe.json
RUN cargo chef cook --package tycho-indexer --release --recipe-path recipe.json
COPY . .
RUN ./stable-build.sh
FROM debian:bookworm
WORKDIR /opt/tycho-indexer
COPY --from=build /build/target/release/tycho-indexer ./tycho-indexer
COPY crates/tycho-indexer/extractors.yaml ./extractors.yaml
RUN apt-get update && apt-get install -y libpq-dev libcurl4 && rm -rf /var/lib/apt/lists/*
ENTRYPOINT [ "/opt/tycho-indexer/tycho-indexer", "--endpoint", "https://mainnet.eth.streamingfast.io:443", "index"]