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