From f64432226af684c0be8b9bd7749f96be7894bda3 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Sat, 23 Apr 2022 18:00:03 +0000 Subject: [PATCH] add dockerfile with caches --- Cargo.toml | 2 +- Dockerfile | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Cargo.toml b/Cargo.toml index 45427b2d..c873c159 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "eth-proxy" +name = "web3-proxy" version = "0.1.0" edition = "2021" diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..cb67ae6a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM rust:1-buster as builder + +WORKDIR /usr/src/web3-proxy +COPY . . +RUN --mount=type=cache,target=/usr/local/cargo/registry \ + --mount=type=cache,target=/usr/src/web3-proxy/target \ + cargo install --path . + +FROM debian:buster-slim +# RUN apt-get update && apt-get install -y extra-runtime-dependencies && rm -rf /var/lib/apt/lists/* +COPY --from=builder /usr/local/cargo/bin/web3-proxy /usr/local/bin/web3-proxy +CMD ["web3-proxy"]