From e0f9263b3f4cb6061a552b9d2ba523b70d2e0851 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Thu, 6 Jul 2023 21:18:45 -0700 Subject: [PATCH] copy the app instead of mount to fix payment-contracts disappearing --- Dockerfile | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0539037b..864b3f1c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -63,14 +63,15 @@ FROM rust as rust_with_env # changing our features doesn't change any of the steps above ENV WEB3_PROXY_FEATURES "deadlock_detection,rdkafka-src" +# copy the app +COPY . . + # fetch deps -RUN --mount=type=bind,target=.,rw \ - --mount=type=cache,target=/root/.cargo/git \ +RUN --mount=type=cache,target=/root/.cargo/git \ --mount=type=cache,target=/root/.cargo/registry \ --mount=type=cache,target=/app/target \ set -eux; \ \ - [ -e "./payment-contracts/src/contracts/mod.rs" ] || touch ./payment-contracts/build.rs; \ cargo --locked --verbose fetch # build tests (done its in own FROM so that it can run in parallel) @@ -80,13 +81,11 @@ COPY --from=rust_foundry /root/.foundry/bin/anvil /root/.foundry/bin/ COPY --from=rust_nextest /root/.cargo/bin/cargo-nextest* /root/.cargo/bin/ # test the application with cargo-nextest -RUN --mount=type=bind,target=.,rw \ - --mount=type=cache,target=/root/.cargo/git \ +RUN --mount=type=cache,target=/root/.cargo/git \ --mount=type=cache,target=/root/.cargo/registry \ --mount=type=cache,target=/app/target \ set -eux; \ \ - [ -e "./payment-contracts/src/contracts/mod.rs" ] || touch ./payment-contracts/build.rs; \ RUST_LOG=web3_proxy=trace,info \ cargo \ --frozen \ @@ -102,13 +101,11 @@ FROM rust_with_env as build_app # # build the release application # # using a "release" profile (which install does by default) is **very** important # # TODO: use the "faster_release" profile which builds with `codegen-units = 1` (but compile is SLOW) -RUN --mount=type=bind,target=.,rw \ - --mount=type=cache,target=/root/.cargo/git \ +RUN --mount=type=cache,target=/root/.cargo/git \ --mount=type=cache,target=/root/.cargo/registry \ --mount=type=cache,target=/app/target \ set -eux; \ \ - [ -e "./payment-contracts/src/contracts/mod.rs" ] || touch ./payment-contracts/build.rs; \ cargo install \ --features "$WEB3_PROXY_FEATURES" \ --frozen \