1
- FROM {{base-image}} AS chef
2
-
3
- RUN cargo install cargo-chef
1
+ FROM lukemathwalker/cargo-chef:latest-rust-bookworm AS chef
4
2
WORKDIR /app
5
3
6
- COPY Cargo.toml Cargo.lock ./
7
-
4
+ FROM chef AS planner
5
+ COPY . .
8
6
RUN cargo chef prepare --recipe-path recipe.json
9
- RUN cargo chef cook --recipe-path recipe.json
10
7
8
+ FROM chef AS builder
9
+ COPY --from=planner /app/recipe.json recipe.json
10
+ RUN cargo chef cook --release --recipe-path recipe.json
11
+
12
+ FROM ghcr.io/foundry-rs/foundry:latest AS foundry
13
+
14
+ FROM chef AS app-builder
11
15
COPY . .
12
16
13
- RUN cargo build --release
17
+ COPY --from=foundry /usr/local/bin/forge /usr/local/bin/forge
18
+ COPY --from=foundry /usr/local/bin/cast /usr/local/bin/cast
19
+ COPY --from=foundry /usr/local/bin/anvil /usr/local/bin/anvil
20
+
21
+ RUN cargo build --release --all
14
22
15
23
FROM debian:bookworm-slim AS runtime
16
24
WORKDIR /app
17
- COPY --from=chef /app/target/release/{{project-name}} /usr/local/bin
25
+
26
+ RUN apt-get update && \
27
+ apt-get install -y libssl3 && \
28
+ rm -rf /var/lib/apt/lists/*
29
+
30
+ COPY --from=app-builder /app/target/release/{{project-name}}-blueprint-bin /usr/local/bin
18
31
19
32
LABEL org.opencontainers.image.authors="{{authors}}"
20
33
LABEL org.opencontainers.image.description="{{project-description}}"
@@ -26,5 +39,7 @@ ENV BIND_ADDR="0.0.0.0"
26
39
ENV BIND_PORT=9632
27
40
ENV BLUEPRINT_ID=0
28
41
ENV SERVICE_ID=0
42
+ ENV CHAIN="testnet"
43
+ ENV KEYSTORE_URI="./keystore"
29
44
30
- ENTRYPOINT ["/usr/local/bin/{{project-name}}" , "run" ]
45
+ ENTRYPOINT ["/usr/local/bin/{{project-name}}-blueprint-bin " , "run" ]
0 commit comments