add dockerfile with caches

This commit is contained in:
Bryan Stitt 2022-04-23 18:00:03 +00:00
parent 7afc0141a6
commit f64432226a
2 changed files with 13 additions and 1 deletions

View File

@ -1,5 +1,5 @@
[package]
name = "eth-proxy"
name = "web3-proxy"
version = "0.1.0"
edition = "2021"

12
Dockerfile Normal file
View File

@ -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"]