FROM rustlang/rust:nightly-slim 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 ln -s /usr/local/lib/libssl.so.3 /usr/lib/libssl.so.3 RUN ln -s /usr/local/lib/libcrypto.so.3 /usr/lib/libcrypto.so.3 RUN USER=root cargo new --bin presence WORKDIR /presence 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/presence* RUN cargo build --release FROM rustlang/rust:nightly-slim ENV RUST_BACKTRACE=full RUN apt-get update && apt install -y openssl libssl-dev COPY --from=build /presence/target/release/presence . EXPOSE 8080 CMD ["./presence"]