From cdb33d549d1bcf27baa654e3b3baf6289f2599e2 Mon Sep 17 00:00:00 2001 From: Aleksander <170264518+t-aleksander@users.noreply.github.com> Date: Mon, 24 Jun 2024 11:55:35 +0200 Subject: [PATCH] change dockerfile --- Dockerfile | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7514038..235fbb1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,15 @@ +FROM node:19-alpine3.16 as web + +WORKDIR /app +COPY web/package.json . +COPY web/pnpm-lock.yaml . +COPY web/.npmrc . +RUN npm i -g pnpm +RUN pnpm install --ignore-scripts --frozen-lockfile +COPY web/ . +RUN pnpm run generate-translation-types +RUN pnpm build + FROM rust:1.75 as chef WORKDIR /build @@ -19,24 +31,14 @@ COPY --from=planner /build/recipe.json recipe.json RUN cargo chef cook --release --recipe-path recipe.json # build project +COPY --from=web /app/dist ./web/dist +COPY web/src/shared/images/svg ./web/src/shared/images/svg RUN apt-get update && apt-get -y install protobuf-compiler libprotobuf-dev COPY Cargo.toml Cargo.lock build.rs ./ COPY src src COPY proto proto RUN cargo install --locked --path . --root /build -FROM node:19-alpine3.16 as web - -WORKDIR /app -COPY web/package.json . -COPY web/pnpm-lock.yaml . -COPY web/.npmrc . -RUN npm i -g pnpm -RUN pnpm install --ignore-scripts --frozen-lockfile -COPY web/ . -RUN pnpm run generate-translation-types -RUN pnpm build - # run FROM debian:bookworm-slim as runtime RUN apt-get update -y && \ @@ -44,6 +46,4 @@ RUN apt-get update -y && \ rm -rf /var/lib/apt/lists/* WORKDIR /app COPY --from=builder /build/bin/defguard-proxy . -COPY --from=web /app/dist ./web/dist -COPY web/src/shared/images/svg ./web/src/shared/images/svg ENTRYPOINT ["./defguard-proxy"]