diff options
author | Santo Cariotti <santo@dcariotti.me> | 2024-09-02 11:01:47 +0200 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2024-09-02 11:01:47 +0200 |
commit | 2e894d1eab0385ea30017624dd761eb5b65fb28b (patch) | |
tree | 2c779cab73ecbd84711f43d987105e381a0e8c6c /Dockerfile | |
parent | 98931e63f71a088328ffdbf7db34a2ecfacf3da8 (diff) |
cd: add step to publish a build in ghcr
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 25 |
1 files changed, 25 insertions, 0 deletions
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"] |