From ff39a6cd825174639d21d9680d0363c750e2e96c Mon Sep 17 00:00:00 2001 From: Jason Yang Date: Tue, 3 Jun 2025 21:57:58 -0700 Subject: [PATCH] feat: using scratch image w/ copy binary from other distro, and included healthcheck --- Dockerfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 01c9aef..f3cfd5e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,10 +19,14 @@ COPY backend/ ./ COPY --from=frontend /app/dist ./ui/dist RUN make -FROM debian:bookworm-slim +FROM scratch +COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ +COPY --from=ghcr.io/tarampampam/curl:8.6.0 /bin/curl /bin/curl COPY --from=backend /app/main /bin/main -RUN apt update && apt install -y ca-certificates && rm -rf /var/lib/apt/lists/* +HEALTHCHECK --interval=5m --timeout=2s --retries=3 --start-period=15s CMD [ \ + "curl", "--fail", "http://127.0.0.1:3909" \ +] -CMD [ "/bin/main" ] +ENTRYPOINT [ "main" ] \ No newline at end of file