Skip to content
22 changes: 19 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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" ]