Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add code support for running HTTPSWatch in Docker #97

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

daknob
Copy link

@daknob daknob commented Oct 6, 2016

This Pull Request adds support for Docker in HTTPS Watch. The way this is achieved is by creating a new docker image with all the files and then installing the dependencies included in requirements.txt. The image uses python3.5. As soon as the image is executed (in a container), two processes start. The first is a bash script, namely /bin/periodic-check.sh, which currently runs check_https.py every 24 hours in the background. The second is the nginx web server, properly configured to serve /out and /static in port 80.
By default, if you don't pass any extra arguments to docker, it will run with the /config included in this repository. However, to allow for easy editing of the configuration file, a docker volume is exposed, namely /httpswatch/config/, so by using docker run with -v /path/to/config:/httpswatch/config/ the configuration file can be overrided with a new one. If you decide to do this, every time you make a change to the configuration file in the host, the docker container will use the new configuration file, just like a cron job.

How to build the Docker Image:

Just run:

docker build -t benjaminp/httpswatch .

How to run a built image:

To run HTTPSWatch with the default configuration file on port tcp/8000, use the following:

docker run -p 8000:80 --rm --name httpswatch benjaminp/httpswatch

To run HTTPSWatch with a custom configuration file, use:

docker run -p 8000:80 --rm --name httpswatch -v /path/to/config:/httpswatch/config/ benjamin/httpswatch

In any case, if you want to run HTTPSWatch in the background, you can also add -d. If you also want to restart automatically the container across host reboots / docker upgrades, remove the --rm and add the --restart=always.

@cybershambles
Copy link
Contributor

Excellent work :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants