copy the app instead of mount to fix payment-contracts disappearing

This commit is contained in:
Bryan Stitt 2023-07-06 21:18:45 -07:00
parent 3d90768dd8
commit e0f9263b3f

@ -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 \