From 2e894d1eab0385ea30017624dd761eb5b65fb28b Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Mon, 2 Sep 2024 11:01:47 +0200 Subject: cd: add step to publish a build in ghcr --- Dockerfile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Dockerfile (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c34bb83 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +# Stage 1 +FROM rust:latest as builder + +WORKDIR /app +COPY . . +RUN cargo build --release + + +# Stage 2 +FROM debian:bookworm-slim + +RUN mkdir -p /app + +RUN groupadd -g 999 appuser && \ + useradd -r -u 999 -g appuser appuser + +USER appuser + +COPY --from=builder /app/target/release/cas /app + +WORKDIR /app + +EXPOSE 8000 + +ENTRYPOINT ["./cas"] -- cgit v1.2.3-18-g5258