dockerize

This commit is contained in:
Mikaël Cluseau
2025-06-30 10:06:28 +02:00
parent 3256f7dbe4
commit 24a45a7825
2 changed files with 16 additions and 0 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
target

15
Dockerfile Normal file
View File

@ -0,0 +1,15 @@
from mcluseau/rust:1.88.0 as build
workdir /app
copy . .
run \
--mount=type=cache,id=rust-alpine-registry,target=/usr/local/cargo/registry \
--mount=type=cache,id=rust-alpine-target,sharing=private,target=/app/target \
cargo build --release \
&& mkdir -p /dist \
&& find target/release -maxdepth 1 -type f -executable -exec cp -v {} /dist/ +
# ------------------------------------------------------------------------
from alpine:3.22
copy --from=build /dist/ /bin/