From d97e392a936b8a2f23f293101c82284b208b3296 Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Wed, 7 Aug 2019 22:24:20 +0200 Subject: [PATCH] Copy cache crate --- Dockerfile | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8ed2ce2..8418647 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,17 +17,21 @@ RUN ./build.sh FROM ekidd/rust-musl-builder:stable as backend # create new cargo project -RUN USER=rust cargo init --bin +RUN USER=rust cargo new --bin gitache +RUN cargo new --lib time-cache +WORKDIR /home/rust/src/gitache # copy build config -COPY --chown=rust ./backend/Cargo.lock ./Cargo.lock -COPY --chown=rust ./backend/Cargo.toml ./Cargo.toml +COPY --chown=rust ./backend/Cargo.lock ./gitache/Cargo.lock +COPY --chown=rust ./backend/Cargo.toml ./gitache/Cargo.toml +COPY --chown=rust ./time-cache/Cargo.toml ./time-cache/Cargo.toml # build to cache dependencies RUN cargo build --release # delete build cache to prevent caching issues later on RUN rm -r ./target/x86_64-unknown-linux-musl/release/.fingerprint/gitache-* -COPY ./backend/static ./static -COPY ./backend/src ./src +COPY ./backend/static ./gitache/static +COPY ./backend/src ./gitache/src +COPY ./time-cache/src ./time-cache/src # build source code RUN cargo build --release @@ -43,7 +47,7 @@ COPY --from=linuxkit/ca-certificates:v0.7 / / COPY --from=user_builder /etc/passwd /etc/passwd USER dummy -COPY --from=backend /home/rust/src/target/x86_64-unknown-linux-musl/release/gitache / +COPY --from=backend /home/rust/src/gitache/target/x86_64-unknown-linux-musl/release/gitache / COPY --from=frontend /output/index.html /public/index.html COPY --from=frontend /output/scripts /public/scripts COPY --from=frontend /output/assets /public/assets