This commit is contained in:
Untone 2024-11-13 09:14:28 +03:00
parent 344c24730c
commit cab36bea24

View File

@ -1,14 +1,13 @@
# Use a specific Rust version that is compatible with your dependencies # Use a specific Rust version that is compatible with your dependencies
FROM rust:slim-buster AS build FROM rust:alpine AS build
# Print system information for debugging # Print system information for debugging
RUN uname -a RUN uname -a
RUN cat /etc/os-release RUN cat /etc/os-release
# Install necessary packages # Install necessary packages
RUN apt-get update -y && \ RUN apk update && \
apt-get install -y git pkg-config make g++ libssl-dev wget \ apk add git pkgconf make g++ openssl libheif libtiff && \
libheif-dev libtiff-dev && \
rustup target add x86_64-unknown-linux-gnu && \ rustup target add x86_64-unknown-linux-gnu && \
rustup select nightly rustup select nightly
@ -34,15 +33,14 @@ COPY ./src ./src
RUN cargo build --release RUN cargo build --release
# Use a minimal runtime image for the final stage # Use a minimal runtime image for the final stage
FROM debian:stable-slim FROM alpine:latest
ENV RUST_BACKTRACE=full ENV RUST_BACKTRACE=full
ENV RUST_LOG=warn ENV RUST_LOG=warn
# Install runtime dependencies # Install runtime dependencies
RUN apt-get update && apt-get install -y openssl libssl-dev \ RUN apk update && apk add openssl libheif libtiff && \
libheif1 libtiff5 && \ apk clean && rm -rf /var/cache/apk/*
apt-get clean && rm -rf /var/lib/apt/lists/*
# Copy the compiled binary from the build stage # Copy the compiled binary from the build stage
COPY --from=build /quoter/target/release/quoter . COPY --from=build /quoter/target/release/quoter .