quoter/Dockerfile

36 lines
712 B
Docker
Raw Normal View History

2024-09-23 12:45:59 +00:00
FROM rust AS build
2023-09-27 23:08:48 +00:00
2023-10-02 11:33:26 +00:00
# had to add this for open-ssl
2023-09-27 23:08:48 +00:00
RUN apt-get update -y && \
2023-10-02 11:33:26 +00:00
apt-get install -y git pkg-config make g++ libssl-dev wget && \
2023-09-27 23:08:48 +00:00
rustup target add x86_64-unknown-linux-gnu
2023-10-02 11:33:26 +00:00
2024-08-30 18:05:51 +00:00
RUN USER=root cargo new --bin quoter
WORKDIR /quoter
2023-10-02 11:33:26 +00:00
2023-09-27 23:08:48 +00:00
COPY ./Cargo.lock ./Cargo.lock
COPY ./Cargo.toml ./Cargo.toml
2023-10-02 11:33:26 +00:00
# cache dependencies
2023-09-27 23:08:48 +00:00
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
RUN cargo build --release
RUN rm src/*.rs
2023-10-02 11:33:26 +00:00
# copy your source tree
2023-09-27 23:08:48 +00:00
COPY ./src ./src
2023-10-02 11:33:26 +00:00
# build for release
2024-08-30 18:05:51 +00:00
RUN rm ./target/release/deps/quoter*
2023-09-27 23:08:48 +00:00
RUN cargo build --release
2024-04-08 17:06:25 +00:00
FROM rust
2023-09-27 23:08:48 +00:00
ENV RUST_BACKTRACE=full
2023-10-02 11:33:26 +00:00
RUN apt-get update && apt install -y openssl libssl-dev
2023-09-27 23:08:48 +00:00
2024-08-30 18:05:51 +00:00
COPY --from=build /quoter/target/release/quoter .
2023-10-11 20:06:27 +00:00
2023-10-12 11:53:28 +00:00
EXPOSE 8080
2024-08-30 18:05:51 +00:00
CMD ["./quoter"]