diff --git a/examples/Readme.md b/examples/Readme.md new file mode 100644 index 0000000..c2606fd --- /dev/null +++ b/examples/Readme.md @@ -0,0 +1,7 @@ +# Minitor Examples + +A few examples of advanced Minitor configuration using Docker Compose. + +These are all built against the local version and not Docker Hub. Before you try anything here, run `make docker-build` from the root `minitor` directory so that the `minitor-dev` image is built on your local host. + +If you are trying to deploy these configs and you would like to use the public image instead, change `minitor-dev` to `iamthefij/minitor`. diff --git a/examples/docker-checks/Dockerfile b/examples/docker-checks/Dockerfile new file mode 100644 index 0000000..bdbdc68 --- /dev/null +++ b/examples/docker-checks/Dockerfile @@ -0,0 +1,3 @@ +FROM minitor-dev + +RUN apt-get update && apt-get install -y jq curl && apt-get clean diff --git a/examples/docker-checks/Readme.md b/examples/docker-checks/Readme.md new file mode 100644 index 0000000..8c917e8 --- /dev/null +++ b/examples/docker-checks/Readme.md @@ -0,0 +1,7 @@ +# Docker Checks + +A sample docker-compose example that uses the bundled shell scripts to monitor the health of other Docker containers. + +## Security note + +Exposing `/var/run/docker.sock` comes at a risk. Please be careful when doing this. If someone is able to take over your Minitor container, they will then essentially have root access to your whole host. To minimize risk, be wary of exposing Minitor to the public internet when using a configuration like this. diff --git a/examples/docker-checks/docker-compose.yml b/examples/docker-checks/docker-compose.yml new file mode 100644 index 0000000..36638e6 --- /dev/null +++ b/examples/docker-checks/docker-compose.yml @@ -0,0 +1,17 @@ +version: '2' +services: + minitor: + build: . + volumes: + - ./config.yml:/app/config.yml + - /var/run/docker.sock:/var/run/docker.sock:ro + + failure: + container_name: failure + image: busybox + command: "sh -c 'exit 1'" + + success: + container_name: success + image: busybox + command: "sh -c 'exit 0'"