From dd938835c8c12d23a36b5fffc630b194282671ce Mon Sep 17 00:00:00 2001 From: Kevin Eaton Date: Fri, 16 Mar 2018 17:20:03 -0400 Subject: [PATCH] Added basic docker support --- Dockerfile | 6 ++++++ README.md | 13 +++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..786ceba --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM python:3 + +RUN pip install --no-cache-dir minitor +WORKDIR /app +COPY config.yml /app/config.yml +CMD minitor \ No newline at end of file diff --git a/README.md b/README.md index aae97d0..b41de2c 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,19 @@ make run It will read the contents of `config.yml` and begin its loop. You could also run it directly and provide a new config file via the `--config` argument. + +#### Docker + +You can pull this repository directly from Docker: + +`docker pull kevineaton/minitor` + +The Docker image uses a default `config.yml` that simply pings a server every 30 seconds with exponential backup. This is likely not what you want, so when you run the Docker image, you should supply your own `config.yml` file: + +`docker run -v $PWD/config.yml:/app/config.yml kevineaton/minitor` + +Note that the image uses the version of minitor in `pip` and does not build from source. + ### Configuring In this repo, you can explore the `sample-config.yml` file for an example, but the general structure is as follows. It should be noted that environment variable interpolation happens on load of the YAML file. Also, when alerts are executed, they will be passed through Python's format function with arguments for some attributes of the Monitor. Currently this is limited to `{monitor_name}`.