commit 84912a330fda86283767c54954bca1ae421e56ef parent 09b32cd80a7a16289acae5196f423b611baf3d0d Author: Mohammed Sohail <sohailsameja@gmail.com> Date: Mon, 27 Mar 2023 09:26:48 +0000 devops: add Dockerfile * uses Docker BuildX * uses multi-stage build Diffstat:
A | Dockerfile | | | 23 | +++++++++++++++++++++++ |
M | README | | | 3 | +++ |
2 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/Dockerfile b/Dockerfile @@ -0,0 +1,23 @@ +FROM rust:1-slim-bullseye AS build + +RUN apt-get update +RUN apt-get install -y build-essential clang llvm pkg-config nettle-dev + +WORKDIR /build +COPY . /build + +RUN cargo build --release --all-features --target x86_64-unknown-linux-gnu +RUN strip ./target/x86_64-unknown-linux-gnu/release/wala + +FROM debian:bullseye-slim + +ENV DEBIAN_FRONTEND=noninteractive +ENV RUST_LOG=info + +WORKDIR /service + +COPY --from=build /build/target/x86_64-unknown-linux-gnu/release/wala . + +EXPOSE 8000 + +CMD ["./wala"] diff --git a/README b/README @@ -2,6 +2,9 @@ Build the binaries: $ cargo build --all-features --release +Build the Docker image: + +$ docker buildx build -t wala:latest . Running the server