diff --git a/Cargo.toml b/Cargo.toml index 18cf4eb3917..58fb3325794 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,13 @@ rust-version = "1.57" [lib] doctest = false +[profile.release] +strip = "symbols" +debug = 0 +lto = "thin" + [profile.dev] +strip = "symbols" debug = 0 [features] diff --git a/docker/dev/Dockerfile b/docker/dev/Dockerfile index 13ff656566b..14096dc07cf 100644 --- a/docker/dev/Dockerfile +++ b/docker/dev/Dockerfile @@ -29,9 +29,6 @@ COPY . . RUN echo "pub const VERSION: &str = \"$(git describe --tag)\";" > "crates/utils/src/version.rs" RUN cargo build --target ${CARGO_BUILD_TARGET} -# reduce binary size -RUN strip ./target/$CARGO_BUILD_TARGET/$RUSTRELEASEDIR/lemmy_server - RUN cp ./target/$CARGO_BUILD_TARGET/$RUSTRELEASEDIR/lemmy_server /app/lemmy_server # The alpine runner diff --git a/docker/prod/Dockerfile b/docker/prod/Dockerfile index 68968007cb2..33a77af88f8 100644 --- a/docker/prod/Dockerfile +++ b/docker/prod/Dockerfile @@ -11,9 +11,6 @@ COPY ./ ./ RUN echo "pub const VERSION: &str = \"$(git describe --tag)\";" > "crates/utils/src/version.rs" RUN cargo build --release -# reduce binary size -RUN strip ./target/$CARGO_BUILD_TARGET/$RUSTRELEASEDIR/lemmy_server - RUN cp ./target/$CARGO_BUILD_TARGET/$RUSTRELEASEDIR/lemmy_server /app/lemmy_server # The alpine runner diff --git a/docker/prod/Dockerfile.arm b/docker/prod/Dockerfile.arm index 2076e942df6..926fa8a7aa5 100644 --- a/docker/prod/Dockerfile.arm +++ b/docker/prod/Dockerfile.arm @@ -15,9 +15,6 @@ RUN echo "pub const VERSION: &str = \"$(git describe --tag)\";" > "crates/utils/ RUN cargo build --release -# reduce binary size -RUN strip ./target/release/lemmy_server - RUN cp ./target/release/lemmy_server /app/lemmy_server # The Debian runner