diff --git a/Dockerfile b/Dockerfile index f8b90d3..6597e92 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,23 @@ FROM debian:bookworm-slim +# NOTE: +# linux-sysmonitor is a Bash-based application, so there are no compiled build artifacts. +# This multi-stage build demonstrates the builder/runtime pattern. The builder prepares +# the application, while the runtime contains only the files and dependencies required +# to execute the script. + +FROM debian:bookworm-slim AS builder + + +WORKDIR /app + +COPY linux-sysmonitor/ . +RUN chmod +x health-check.sh + +FROM debian:bookworm-slim + +WORKDIR /app + +COPY --from=builder /app/health-check.sh . WORKDIR /app @@ -8,7 +27,4 @@ RUN apt-get update && apt-get install -y \ iputils-ping \ iproute2 \ bash && rm -rf /var/lib/apt/lists/* - -COPY linux-sysmonitor/ . -RUN chmod +x health-check.sh ENTRYPOINT [ "./health-check.sh" ] \ No newline at end of file