mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2025-12-06 07:25:36 +01:00
31 lines
723 B
Docker
31 lines
723 B
Docker
FROM lukemathwalker/cargo-chef:latest-rust-slim-buster AS chef
|
|
WORKDIR /app
|
|
|
|
FROM chef AS planner
|
|
COPY . .
|
|
RUN cargo chef prepare --recipe-path recipe.json
|
|
|
|
FROM chef AS builder
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y pkg-config libssl-dev \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY --from=planner /app/recipe.json recipe.json
|
|
RUN cargo chef cook --release --recipe-path recipe.json
|
|
COPY . .
|
|
RUN cargo build --release --bin book_bot
|
|
|
|
FROM debian:bullseye-slim
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y openssl ca-certificates \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN update-ca-certificates
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=builder /app/target/release/book_bot /usr/local/bin
|
|
ENTRYPOINT ["/usr/local/bin/book_bot"]
|