diff --git a/Dockerfile b/Dockerfile index fbbfed8..4994ada 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,16 +10,6 @@ FROM bun AS js-deps COPY package.json bun.lock /temp/dev/ RUN cd /temp/dev && bun install --frozen-lockfile -# copy node_modules from temp directory -# then copy all (non-ignored) project files into the image -FROM bun AS js-bundler -COPY --from=js-deps /temp/dev/node_modules node_modules -COPY frontend frontend -COPY .devfiles/scripts/build-frontend.ts .devfiles/scripts/build-frontend.ts - -ENV NODE_ENV=production -RUN bun ./.devfiles/scripts/build-frontend.ts - # ── Rust ──────────────────────────────────────────────────────────────── FROM rust:slim AS builder @@ -36,9 +26,9 @@ RUN adduser \ --uid 10001 \ appuser -COPY --from=js-bundler /usr/src/app/dist dist - COPY . . +COPY --from=js-deps /usr/local/bin/bun /usr/local/bin/bun +COPY --from=js-deps /temp/dev/node_modules node_modules RUN --mount=type=cache,target=/app/target/ \ --mount=type=cache,target=/usr/local/cargo/git/db \