quoter/Dockerfile
Untone 2979146b34
Some checks failed
deploy / deploy (push) Failing after 5s
slim-buster
2024-11-13 09:05:33 +03:00

44 lines
897 B
Docker

FROM rust:slim-buster AS build
RUN uname -a
RUN cat /etc/os-release # print ubuntu version
# had to add this for open-ssl
RUN apt-get update -y && \
apt-get install -y git pkg-config make g++ libssl-dev wget \
libheif-dev libtiff-dev libtiff5-dev && \
rustup target add x86_64-unknown-linux-gnu
RUN USER=root cargo new --bin quoter
WORKDIR /quoter
COPY ./Cargo.lock ./Cargo.lock
COPY ./Cargo.toml ./Cargo.toml
# cache dependencies
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
RUN cargo build --release
RUN rm src/*.rs
# copy your source tree
COPY ./src ./src
# build for release
RUN rm ./target/release/deps/quoter*
RUN cargo build --release
FROM rust:slim-buster
ENV RUST_BACKTRACE=full
ENV RUST_LOG=warn
RUN apt-get update && apt install -y openssl libssl-dev \
libheif1 libtiff5
COPY --from=build /quoter/target/release/quoter .
ENV PORT=8080
EXPOSE 8080
CMD ["./quoter"]