Obsessed-Yanqing/Dockerfile

25 lines
690 B
Docker
Raw Normal View History

2023-06-26 23:25:52 +02:00
FROM rust:slim-bullseye AS base
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 13:15:28 +02:00
FROM bitnami/minideb:bullseye
2023-06-26 23:25:52 +02:00
RUN apt-get update
RUN apt-get install ca-certificates -y
2023-06-28 13:15:28 +02:00
RUN apt-get clean autoclean
RUN apt-get autoremove --yes
RUN 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"]