Add code support for running HTTPSWatch in Docker #97
+94
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This Pull Request adds support for Docker in HTTPS Watch. The way this is achieved is by creating a new
dockerimage with all the files and then installing the dependencies included inrequirements.txt. The image usespython3.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 runscheck_https.pyevery 24 hours in the background. The second is thenginxweb server, properly configured to serve/outand/staticin port 80.By default, if you don't pass any extra arguments to
docker, it will run with the/configincluded in this repository. However, to allow for easy editing of the configuration file, adockervolume is exposed, namely/httpswatch/config/, so by usingdocker runwith-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, thedockercontainer will use the new configuration file, just like acronjob.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:To run HTTPSWatch with a custom configuration file, use:
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 /dockerupgrades, remove the--rmand add the--restart=always.