Copy cache crate
This commit is contained in:
parent
501257684e
commit
d97e392a93
16
Dockerfile
16
Dockerfile
@ -17,17 +17,21 @@ RUN ./build.sh
|
|||||||
FROM ekidd/rust-musl-builder:stable as backend
|
FROM ekidd/rust-musl-builder:stable as backend
|
||||||
|
|
||||||
# create new cargo project
|
# 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 build config
|
||||||
COPY --chown=rust ./backend/Cargo.lock ./Cargo.lock
|
COPY --chown=rust ./backend/Cargo.lock ./gitache/Cargo.lock
|
||||||
COPY --chown=rust ./backend/Cargo.toml ./Cargo.toml
|
COPY --chown=rust ./backend/Cargo.toml ./gitache/Cargo.toml
|
||||||
|
COPY --chown=rust ./time-cache/Cargo.toml ./time-cache/Cargo.toml
|
||||||
# build to cache dependencies
|
# build to cache dependencies
|
||||||
RUN cargo build --release
|
RUN cargo build --release
|
||||||
# delete build cache to prevent caching issues later on
|
# delete build cache to prevent caching issues later on
|
||||||
RUN rm -r ./target/x86_64-unknown-linux-musl/release/.fingerprint/gitache-*
|
RUN rm -r ./target/x86_64-unknown-linux-musl/release/.fingerprint/gitache-*
|
||||||
|
|
||||||
COPY ./backend/static ./static
|
COPY ./backend/static ./gitache/static
|
||||||
COPY ./backend/src ./src
|
COPY ./backend/src ./gitache/src
|
||||||
|
COPY ./time-cache/src ./time-cache/src
|
||||||
# build source code
|
# build source code
|
||||||
RUN cargo build --release
|
RUN cargo build --release
|
||||||
|
|
||||||
@ -43,7 +47,7 @@ COPY --from=linuxkit/ca-certificates:v0.7 / /
|
|||||||
COPY --from=user_builder /etc/passwd /etc/passwd
|
COPY --from=user_builder /etc/passwd /etc/passwd
|
||||||
USER dummy
|
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/index.html /public/index.html
|
||||||
COPY --from=frontend /output/scripts /public/scripts
|
COPY --from=frontend /output/scripts /public/scripts
|
||||||
COPY --from=frontend /output/assets /public/assets
|
COPY --from=frontend /output/assets /public/assets
|
||||||
|
Loading…
Reference in New Issue
Block a user