fix: cache backend core builds and flush ssh output
This commit is contained in:
@@ -1,11 +1,18 @@
|
||||
# syntax=docker/dockerfile:1.7
|
||||
FROM rust:1-bookworm AS build
|
||||
WORKDIR /app/src/components/backend-core
|
||||
ARG CARGO_BUILD_JOBS=1
|
||||
ENV CARGO_BUILD_JOBS=${CARGO_BUILD_JOBS}
|
||||
COPY src/components/backend-core/Cargo.toml ./Cargo.toml
|
||||
COPY src/components/backend-core/Cargo.lock ./Cargo.lock
|
||||
RUN mkdir -p src \
|
||||
&& printf 'fn main() {}\n' > src/main.rs \
|
||||
&& cargo build --release --locked --jobs "${CARGO_BUILD_JOBS}" \
|
||||
&& rm -rf src
|
||||
COPY src/components/backend-core/src ./src
|
||||
RUN cargo build --release --jobs "${CARGO_BUILD_JOBS}"
|
||||
RUN rm -f target/release/backend-core target/release/backend-core.d \
|
||||
&& find target/release/.fingerprint -maxdepth 1 -type d -name 'unidesk-backend-core-*' -exec rm -rf {} + \
|
||||
&& cargo build --release --locked --jobs "${CARGO_BUILD_JOBS}"
|
||||
|
||||
FROM postgres:16-bookworm
|
||||
RUN apt-get update \
|
||||
|
||||
Reference in New Issue
Block a user