diff --git a/Cargo.toml b/Cargo.toml index cc97298..ab9e71b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,14 @@ name = "account" version = "0.1.0" edition = "2024" - +[profile.prod] +inherits = "release" +overflow-checks = false +strip = true +debug = false +debug-assertions = false +lto = true +incremental = false [dependencies] rocket = "0.5.1" diff --git a/Dockerfile b/Dockerfile index 10b2c0f..ba283ca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ WORKDIR /app COPY . . -RUN cargo build --release +RUN cargo build --profile prod RUN rm .env @@ -15,7 +15,7 @@ FROM rust:alpine AS final WORKDIR /app # Copy the compiled binary from the builder stage -COPY --from=builder /app/target/release/account /app/account +COPY --from=builder /app/target/prod/account /app/account # Set executable permissions RUN chmod +x /app/account