release build

This commit is contained in:
Dmitry Belyaev 2024-09-12 20:08:53 +03:00
parent 1f8a81e731
commit 03e4e670a9
Signed by: b4tman
GPG Key ID: 41A00BF15EA7E5F3
2 changed files with 11 additions and 5 deletions

View File

@ -19,3 +19,9 @@ parse_duration = "2.1.1"
serde = "1.0.210"
tokio = {version = "1.40.0", features = ["full"]}
tokio-macros = "2.4.0"
[profile.release]
opt-level = 3
debug = false
lto = true
strip = true

View File

@ -5,13 +5,13 @@ FROM chef AS planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
FROM chef AS builder
COPY --from=planner /app/recipe.json recipe.json
RUN cargo chef cook --recipe-path recipe.json
RUN cargo chef cook --release --recipe-path recipe.json
COPY . .
RUN cargo build
RUN cargo build --release
FROM debian:12-slim AS runtime
WORKDIR /app
COPY --from=builder /app/target/debug/doctor-restart /usr/local/bin
ENTRYPOINT ["/usr/local/bin/doctor-restart"]
COPY --from=builder /app/target/release/doctor-restart /usr/local/bin
ENTRYPOINT ["/usr/local/bin/doctor-restart"]