From 2ea0d06d62e44a9cae2897aa04638cd7fd3ca6be Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Fri, 4 Aug 2023 17:14:18 +0200 Subject: [PATCH] Lightning fast docker rebuilds --- Dockerfile | 2 +- packages/backend/native-utils/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 323ee196b..2bb074303 100644 --- a/Dockerfile +++ b/Dockerfile @@ -57,7 +57,7 @@ RUN --mount=type=cache,target=/iceshrimp/.yarncache rm -rf .yarncache/* && cp -T COPY packages/backend/native-utils packages/backend/native-utils/ # Compile native-utils utilising sccache -RUN --mount=type=cache,target=/root/.cargo --mount=type=cache,target=/tmp/sccache yarn workspace native-utils build +RUN --mount=type=cache,target=/root/.cargo --mount=type=cache,target=/tmp/sccache --mount=type=cache,target=/iceshrimp/packages/backend/native-utils/target --mount=type=cache,target=/iceshrimp/packages/backend/native-utils/migration/target yarn workspace native-utils build # Copy in the rest of the files to compile COPY . ./ diff --git a/packages/backend/native-utils/package.json b/packages/backend/native-utils/package.json index 05623cc1f..bc23e9e88 100644 --- a/packages/backend/native-utils/package.json +++ b/packages/backend/native-utils/package.json @@ -36,7 +36,7 @@ "artifacts": "napi artifacts", "build": "yarn build:napi && yarn build:migration", "build:napi": "napi build --features napi --platform --release ./built/", - "build:migration": "cargo build --locked --profile release-no-lto -p migration && cp ./target/release-no-lto/migration ./built/migration", + "build:migration": "cargo build --locked --profile release-no-lto -p migration --target-dir migration/target && cp ./migration/target/release-no-lto/migration ./built/migration", "build:debug": "napi build --platform ./built/ && cargo build -p migration", "prepublishOnly": "napi prepublish -t npm", "test": "yarn cargo:test && yarn build:napi && ava",