diff --git a/Dockerfile b/Dockerfile index 185f9929..72583812 100755 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ COPY Cargo.toml Cargo.lock ./ # Create a minimal project to download and cache dependencies RUN mkdir -p src && \ echo 'fn main() { println!("Dummy build for caching dependencies"); }' > src/main.rs && \ - cargo build --release && \ + RUSTFLAGS="-C target-cpu=native" cargo build --release && \ rm -rf src target/release/deps/oxicloud* # Stage 2: Build the application FROM rust:1.93.0-alpine3.23 AS builder @@ -24,7 +24,7 @@ COPY static static COPY db db # Build with all optimizations (DATABASE_URL only needed at compile-time for sqlx) ARG DATABASE_URL="postgres://postgres:postgres@localhost/oxicloud" -RUN DATABASE_URL="${DATABASE_URL}" cargo build --release +RUN DATABASE_URL="${DATABASE_URL}" RUSTFLAGS="-C target-cpu=native" cargo build --release # Stage 3: Create minimal final image FROM alpine:3.23.3