From 0073eaa1692db13239dcd66758fbea947ba729e7 Mon Sep 17 00:00:00 2001 From: Natty Date: Sun, 5 Nov 2023 22:41:30 +0100 Subject: [PATCH] Build things before user is modified --- Dockerfile | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9866a20..e988567 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,8 +6,19 @@ RUN apt update RUN apt install -y git nodejs npm RUN npm install -g corepack +RUN corepack enable && corepack prepare pnpm@latest --activate + +WORKDIR /magnetar +COPY ./ . + WORKDIR /magnetar/fe_calckey/frontend -RUN corepack enable && corepack prepare pnpm@latest --activate && pnpm i --frozen-lockfile +RUN pnpm i --frozen-lockfile + +RUN cargo build --release --locked --workspace --bins + +WORKDIR /magnetar/fe_calckey/frontend + +RUN env NODE_ENV=production sh -c "pnpm run build && pnpm run gulp" ENV USER=magnetar ENV UID=10001 @@ -20,16 +31,6 @@ RUN adduser \ --uid "${UID}" \ "${USER}" -WORKDIR /magnetar - -COPY ./ . - -RUN cargo build --release --locked --workspace --bins - -WORKDIR /magnetar/fe_calckey/frontend - -RUN env NODE_ENV=production sh -c "pnpm run build && pnpm run gulp" - FROM docker.io/debian:bullseye-slim COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt