aboutsummaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2025-08-13 12:10:24 +0200
committerLinnea Gräf <nea@nea.moe>2025-08-13 12:10:24 +0200
commitede8ab2d7fb241b677964d393ce7c4cac5006a4d (patch)
tree3455c18b6994f46702a94b3595b99a7e9c9fc06c /Dockerfile
parentae5b6ad34ce4aca94816e2147774616fb6b7e135 (diff)
downloaddiscordavatarproxy-ede8ab2d7fb241b677964d393ce7c4cac5006a4d.tar.gz
discordavatarproxy-ede8ab2d7fb241b677964d393ce7c4cac5006a4d.tar.bz2
discordavatarproxy-ede8ab2d7fb241b677964d393ce7c4cac5006a4d.zip
feat: docker publishing
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile22
1 files changed, 22 insertions, 0 deletions
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"]