Skip to content

Commit

Permalink
change dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
t-aleksander committed Jun 24, 2024
1 parent d9f8eb6 commit cdb33d5
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -19,31 +31,19 @@ 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 && \
apt-get install --no-install-recommends -y ca-certificates && \
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"]

0 comments on commit cdb33d5

Please sign in to comment.