diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f8b90d3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM debian:bookworm-slim + + +WORKDIR /app + +RUN apt-get update && apt-get install -y \ + procps \ + 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 diff --git a/README.md b/README.md index eb935fc..2ca22f5 100644 --- a/README.md +++ b/README.md @@ -128,6 +128,22 @@ chmod +x health-check.sh chmod +x analyse.sh ``` +## Build the Docker Image + +From the repository root, build the container image with: + +```bash +docker build -t linux-sysmonitor:latest . +``` + +## Run the Docker Container + +Run the health check inside the container and persist logs to the local `logs` directory: + +```bash +docker run --rm -v "$PWD/logs:/app/logs" linux-sysmonitor:latest +``` + --- # 🚦 Usage