Merge branch 'dockerfile'
This commit is contained in:
commit
01905c895e
6
.dockerignore
Normal file
6
.dockerignore
Normal file
@ -0,0 +1,6 @@
|
||||
*$py.class
|
||||
*.egg
|
||||
*.egg-info/
|
||||
*.py[cod]
|
||||
*.so
|
||||
**/__pycache__/
|
13
Dockerfile
Normal file
13
Dockerfile
Normal file
@ -0,0 +1,13 @@
|
||||
FROM python:3
|
||||
LABEL maintainer="ian@iamthefij.com"
|
||||
# Minitor: https://git.iamthefij.com/iamthefij/minitor
|
||||
|
||||
COPY ./sample-config.yml /app/config.yml
|
||||
WORKDIR /app
|
||||
|
||||
COPY ./README.md /app/
|
||||
COPY ./setup.py /app/
|
||||
COPY ./minitor /app/minitor
|
||||
RUN pip install -e .
|
||||
|
||||
ENTRYPOINT python -m minitor.main
|
5
Makefile
5
Makefile
@ -1,3 +1,4 @@
|
||||
DOCKER_TAG := minitor-dev
|
||||
OPEN_CMD := $(shell type xdg-open > /dev/null && echo 'xdg-open' || echo 'open')
|
||||
|
||||
.PHONY: default
|
||||
@ -80,3 +81,7 @@ htmlcov/index.html: .coverage
|
||||
.PHONY: open-coverage
|
||||
open-coverage: htmlcov/index.html
|
||||
$(OPEN_CMD) htmlcov/index.html
|
||||
|
||||
.PHONY: docker-build
|
||||
docker-build:
|
||||
docker build . -t $(DOCKER_TAG)
|
||||
|
11
README.md
11
README.md
@ -29,6 +29,17 @@ 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 iamthefij/minitor`
|
||||
|
||||
The Docker image uses a default `config.yml` that is copied from `sample-config.yml`. This won't really do anything for you, so when you run the Docker image, you should supply your own `config.yml` file:
|
||||
|
||||
`docker run -v $PWD/config.yml:/app/config.yml iamthefij/minitor`
|
||||
|
||||
### 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}`.
|
||||
|
Loading…
Reference in New Issue
Block a user