quoter/Dockerfile
Untone bd3f3661c4
All checks were successful
deploy / deploy (push) Successful in 49s
rust-debug
2024-10-02 18:55:38 +03:00

39 lines
746 B
Docker

FROM rust AS build
# had to add this for open-ssl
RUN apt-get update -y && \
apt-get install -y git pkg-config make g++ libssl-dev wget && \
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
ENV RUST_BACKTRACE=full
ENV RUST_LOG=debug
RUN apt-get update && apt install -y openssl libssl-dev
COPY --from=build /quoter/target/release/quoter .
ENV PORT=8080
EXPOSE 8080
CMD ["./quoter"]