2023-06-28 14:08:09 +02:00
|
|
|
FROM rust:slim-bookworm AS base
|
2023-06-26 23:25:52 +02:00
|
|
|
RUN apt-get update
|
|
|
|
RUN apt-get install libssl-dev pkg-config -y
|
2023-05-28 22:00:23 +02:00
|
|
|
RUN cargo install cargo-chef
|
|
|
|
WORKDIR app
|
|
|
|
|
2023-06-26 23:25:52 +02:00
|
|
|
FROM base AS planner
|
2023-05-28 22:00:23 +02:00
|
|
|
COPY . .
|
|
|
|
RUN cargo chef prepare --recipe-path recipe.json
|
|
|
|
|
2023-06-26 23:25:52 +02:00
|
|
|
FROM base AS builder
|
2023-05-28 22:00:23 +02:00
|
|
|
COPY --from=planner /app/recipe.json recipe.json
|
|
|
|
RUN cargo chef cook --release --recipe-path recipe.json
|
|
|
|
COPY . .
|
|
|
|
RUN cargo build --release --bin obsessed-yanqing
|
|
|
|
|
2023-06-28 14:08:09 +02:00
|
|
|
FROM debian:bookworm-slim
|
|
|
|
RUN apt-get update && apt-get install ca-certificates libssl3 -y && apt-get clean autoclean && apt-get autoremove --yes && rm -rf /var/lib/{apt,dpkg,cache,log}/
|
2023-06-26 23:25:52 +02:00
|
|
|
WORKDIR /root/
|
2023-06-26 13:56:58 +02:00
|
|
|
COPY --from=builder /app/target/release/obsessed-yanqing .
|
|
|
|
CMD ["./obsessed-yanqing"]
|