Skip to content

Commit

Permalink
more caching in the OSS dockerfile (#33842)
Browse files Browse the repository at this point in the history
this speeds up rebuilds a bit

GitOrigin-RevId: 0006063f131acea60997efa26cf4dd505be4a535
  • Loading branch information
gautamg795 authored and Convex, Inc. committed Jan 31, 2025
1 parent 87864d5 commit a218d35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions self-hosted/Dockerfile.backend
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ RUN --mount=type=cache,target=/convex/npm-packages/common/temp/,sharing=locked j
COPY --from=chef /tmp/recipe.json recipe.json
# Use cargo-chef to build dependencies from the recipe created in the first stage
# This step will be cached unless dependencies change
RUN --mount=type=cache,target=/convex/target/ cargo chef cook --release --recipe-path recipe.json
RUN --mount=type=cache,target=/convex/target/ --mount=type=cache,target=/usr/local/cargo/git/db --mount=type=cache,target=/usr/local/cargo/registry/ cargo chef cook --release --recipe-path recipe.json
# Now copy everything else over -- we've minimized the set of files that cause a full `rush install` or `cargo build` to run.
COPY . .

# Build the convex-local-backend binary
RUN --mount=type=cache,target=/convex/npm-packages/common/temp/,sharing=locked --mount=type=cache,target=/convex/target/ <<EOF
RUN --mount=type=cache,target=/convex/npm-packages/common/temp/,sharing=locked --mount=type=cache,target=/convex/target/ --mount=type=cache,target=/usr/local/cargo/git/db --mount=type=cache,target=/usr/local/cargo/registry/ <<EOF
cargo build --release -p local_backend --bin convex-local-backend
cp target/release/convex-local-backend .
EOF
Expand Down

0 comments on commit a218d35

Please sign in to comment.