Obsessed-Yanqing/Dockerfile

22 lines
585 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-26 23:25:52 +02:00
FROM rust:slim-bullseye
RUN apt-get update
RUN apt-get install ca-certificates -y
WORKDIR /root/
2023-06-26 13:56:58 +02:00
COPY --from=builder /app/target/release/obsessed-yanqing .
CMD ["./obsessed-yanqing"]