This commit is contained in:
2023-10-02 12:22:04 +03:00
parent 7ba39c67f9
commit adc65909f1
5 changed files with 568 additions and 52 deletions

View File

@@ -1,24 +1,24 @@
FROM rustlang/rust:nightly-slim as build
WORKDIR /notifier
WORKDIR /presense
RUN apt-get update -y && \
apt-get install -y libssl-dev && \
rustup target add x86_64-unknown-linux-gnu
RUN USER=root cargo new --bin notifier
RUN USER=root cargo new --bin presense
COPY ./Cargo.lock ./Cargo.lock
COPY ./Cargo.toml ./Cargo.toml
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
RUN cargo build --release
RUN rm src/*.rs
COPY ./src ./src
RUN rm ./target/release/deps/notifier*
RUN rm ./target/release/deps/presense*
RUN cargo build --release
FROM rustlang/rust:nightly-slim
ENV RUST_BACKTRACE=full
RUN apt-get update && apt install -y openssl
COPY --from=build /notifier/target/release/notifier .
COPY --from=build /notifier/target/release/presense .
EXPOSE 8080
CMD ["./notifier"]
CMD ["./presense"]