From ede8ab2d7fb241b677964d393ce7c4cac5006a4d Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Wed, 13 Aug 2025 12:10:24 +0200 Subject: feat: docker publishing --- Dockerfile | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Dockerfile (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..71200f8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM clux/muslrust:1.89.0 AS chef +USER root +RUN cargo install cargo-chef +WORKDIR /app + +FROM chef AS planner +COPY . . +RUN rm rust-toolchain.toml +RUN cargo chef prepare --recipe-path recipe.json + +FROM chef AS builder +COPY --from=planner /app/recipe.json recipe.json +# Notice that we are specifying the --target flag! +RUN cargo chef cook --release --target x86_64-unknown-linux-musl --recipe-path recipe.json +COPY . . +RUN rm rust-toolchain.toml +RUN cargo build --release --target x86_64-unknown-linux-musl --bin pfp + +FROM docker.io/alpine:3 AS runtime +WORKDIR /app +COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/pfp /usr/local/bin/ +CMD ["/usr/local/bin/pfp"] -- cgit