Update Dockerfile to build the current working copy

This will allow `latest` to be `master` and allow git tags to dictate
tagged versions on Docker.

Also update readme to describe how it's now building
This commit is contained in:
IamTheFij 2018-04-17 21:01:58 -07:00
parent dd938835c8
commit f4952b61d1
4 changed files with 24 additions and 8 deletions

6
.dockerignore Normal file
View File

@ -0,0 +1,6 @@
*$py.class
*.egg
*.egg-info/
*.py[cod]
*.so
**/__pycache__/

View File

@ -1,6 +1,13 @@
FROM python:3
LABEL maintainer="ian@iamthefij.com"
# Minitor: https://git.iamthefij.com/iamthefij/minitor
RUN pip install --no-cache-dir minitor
COPY ./sample-config.yml /app/config.yml
WORKDIR /app
COPY config.yml /app/config.yml
CMD minitor
COPY ./README.md /app/
COPY ./setup.py /app/
COPY ./minitor /app/minitor
RUN pip install -e .
ENTRYPOINT python -m minitor.main

View File

@ -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)

View File

@ -34,13 +34,11 @@ It will read the contents of `config.yml` and begin its loop. You could also run
You can pull this repository directly from Docker:
`docker pull kevineaton/minitor`
`docker pull iamthefij/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:
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 kevineaton/minitor`
Note that the image uses the version of minitor in `pip` and does not build from source.
`docker run -v $PWD/config.yml:/app/config.yml iamthefij/minitor`
### Configuring