Migrate to MUSL

This commit is contained in:
2026-02-06 21:35:28 -03:00
parent 384ca1f4e8
commit 1c79d4b701
6 changed files with 76 additions and 40 deletions
+17 -8
View File
@@ -1,19 +1,28 @@
FROM rust:latest AS builder
# --- Builder stage ---
FROM rust:1-bookworm AS builder
# Install musl target and musl-tools
RUN rustup target add x86_64-unknown-linux-musl \
&& apt-get update \
&& apt-get install -y musl-tools build-essential
WORKDIR /app
COPY Cargo.toml Cargo.lock ./
COPY . .
RUN cargo build --release
# Build fully static binary
RUN cargo build --release --target x86_64-unknown-linux-musl
# --- Final stage ---
FROM debian:bookworm
COPY --from=builder /app/target/release/payphone /usr/local/bin/payphone
# Copy static binary
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/payphone /usr/local/bin/payphone
RUN apt-get update && apt-get install -y ca-certificates
RUN update-ca-certificates
RUN apt-get update && apt-get install -y ca-certificates \
&& update-ca-certificates \
&& rm -rf /var/lib/apt/lists/*
ENTRYPOINT [ "/usr/local/bin/payphone" ]
CMD [ "start" ]
ENTRYPOINT ["/usr/local/bin/payphone"]
CMD ["start"]