From e1cc460f955b772889af9f975f5786fff9adbb67 Mon Sep 17 00:00:00 2001 From: ms1331 <59427990+ms1331@users.noreply.github.com> Date: Tue, 12 Nov 2024 04:27:24 -0600 Subject: [PATCH] dont ship full rust dev environment when a couple of binaries are enough (#17) --- Dockerfile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index cfd9d2f..f1a2ece 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,17 @@ -FROM rust:latest +FROM rust:alpine AS build -RUN cargo install monolith +RUN apk add musl-dev perl make RUN cargo install textpod +RUN cargo install monolith + +FROM alpine +COPY --from=build /usr/local/cargo/bin/textpod /usr/bin/textpod +COPY --from=build /usr/local/cargo/bin/monolith /usr/bin/monolith WORKDIR /app/notes HEALTHCHECK --interval=60s --retries=3 --timeout=1s \ -CMD curl -f http://localhost:3000/ || exit 1 +CMD nc -z -w 1 localhost 3000 || exit 1 ENTRYPOINT ["textpod"] -CMD ["-p", "3000", "-l", "0.0.0.0"] \ No newline at end of file +CMD ["-p", "3000", "-l", "0.0.0.0"]