From 75a5e3740fdafc270a648ed2b21ead1772cd1a6d Mon Sep 17 00:00:00 2001
From: Dmitry <b4tm4n@mail.ru>
Date: Wed, 2 Apr 2025 16:03:42 +0300
Subject: [PATCH] Dockerfile: cargo install peazyrsa from git

---
 Dockerfile | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 4c4019e..b4a6bbc 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -5,16 +5,8 @@ RUN cargo install trunk
 RUN rustup target add wasm32-unknown-unknown
 WORKDIR /app
 
-FROM chef AS planner-peazyrsa
-RUN git clone https://gitea.b4tman.ru/b4tman/peazyrsa -b v0.1.0 --depth 1 .
-RUN cargo chef prepare  --recipe-path recipe.json
-
 FROM chef AS builder-peazyrsa
-COPY --from=planner-peazyrsa /app/recipe.json recipe.json
-RUN cargo chef cook --release --recipe-path recipe.json
-RUN git clone https://gitea.b4tman.ru/b4tman/peazyrsa -b v0.1.0 --depth 1 peazyrsa
-RUN cp -af peazyrsa/* . && rm -rf peazyrsa
-RUN cargo build --release
+RUN cargo install --git https://gitea.b4tman.ru/b4tman/peazyrsa --tag v0.1.0
 
 FROM chef AS planner-peasyweb
 COPY . .
@@ -36,7 +28,7 @@ RUN apk add --no-cache openssl libssl3 libcrypto3
 RUN mkdir -p /app/frontend
 RUN mkdir /data
 WORKDIR /app
-COPY --from=builder-peazyrsa /app/target/release/peazyrsa /usr/local/bin/peazyrsa
+COPY --from=builder-peazyrsa /usr/local/cargo/bin/peazyrsa /usr/local/bin/peazyrsa
 COPY --from=builder-peasyweb /app/target/release/peazyweb-backend /usr/local/bin/peazyweb-backend
 COPY --from=builder-peasyweb /app/frontend/dist/ /app/frontend
 
@@ -53,4 +45,4 @@ ENV ROCKET_PORT=80
 
 EXPOSE 80
 
-ENTRYPOINT ["/usr/local/bin/peazyweb-backend"]
\ No newline at end of file
+ENTRYPOINT ["/usr/local/bin/peazyweb-backend"]