summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Mazoyer <gmazoyer@gravitons.in>2016-09-01 16:38:30 +0200
committerGuillaume Mazoyer <gmazoyer@gravitons.in>2016-09-01 16:38:30 +0200
commitdb12f293f91a986ab031afb7a79744f790f0985d (patch)
tree90d9abb636902257b01be60da12e7a839a14cc12
parent90f302bf68924b68e93366447db64d4b808acdf3 (diff)
Add Dockerfile.
Add a Dockerfile to build Docker images. Also add a documentation file to help building Docker for this looking glass. The official Docker image uses the PHP image with Apache 2 and PHP 5.6.
-rw-r--r--CHANGELOG.md2
-rw-r--r--Dockerfile15
-rw-r--r--README.md9
-rw-r--r--docs/docker.md40
4 files changed, 64 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ae35724..a7d3834 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,7 +8,7 @@
below the main buttons allowing to display the policy in a modal
* Add configuration option to disable IPv6 or IPv4 for defined routers ;
using this option will limit the query to the enabled protocol version
- (both versions of the protocol are enabled by default).
+ (both versions of the protocol are enabled by default)
* Add configuration option to set the connection timeout for defined
routers ; it can be useful when a query takes a long time (ie traceroute
with hidden hosts in the path)
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..fb5eb07
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,15 @@
+FROM php:5.6-apache
+MAINTAINER Guillaume Mazoyer <gmazoyer@gravitons.in>
+
+# Need git
+RUN apt-get update && apt-get install -y git
+
+WORKDIR /var/www/html
+
+# Clone repository with given branch
+ARG BRANCH=master
+ARG URL=https://github.com/respawner/looking-glass.git
+RUN git clone --depth 1 $URL -b $BRANCH .
+
+# Get rid of git
+RUN apt-get purge -y --auto-remove git
diff --git a/README.md b/README.md
index eb59caf..500fcce 100644
--- a/README.md
+++ b/README.md
@@ -37,7 +37,14 @@ future:
Copy the configuration **config.php.example** file to create a **config.php**
file. It contains all the values (PHP variables) used to customize the looking
-glass.
+glass. Details about configuration options are available in the
+[documentation](docs/configuration.md).
+
+## Docker
+
+If you want to run the looking glass inside a Docker container, a Dockerfile
+is provided in this repository. Some more details can be found
+[here](docs/docker.md).
## Documentation
diff --git a/docs/docker.md b/docs/docker.md
new file mode 100644
index 0000000..40607d0
--- /dev/null
+++ b/docs/docker.md
@@ -0,0 +1,40 @@
+# Looking Glass: Using Docker
+
+This looking glass can be run inside a Docker container as long as it meets
+the requirements listed in the README. You can use the shipped Dockerfile or
+create your own to match your need.
+
+## Pulling an existing image
+
+Looking Glass is available on
+[Docker Hub](https://hub.docker.com/r/gmazoyer/looking-glass/) and can be
+pulled from there.All official releases of Looking Glass will be pushed on
+Docker Hub as soon as they are released. Just run
+`docker pull gmazoyer/looking-glass` and you'll get the latest release. You
+can also grab any tagged release by using the tag you need.
+
+## Building your own image
+
+If you need to build you own Docker container you'll only need to have a
+webserver that is comfortable with interpreting PHP files. Be aware that it is
+not yet compatible with PHP 7. However the compatibility has been tested from
+PHP 5.3 up to PHP 5.6 (included). You can track down compatibility with PHP
+versions [here](https://travis-ci.org/respawner/looking-glass).
+
+## Usage and options
+
+It is not recommended to add any SSH keys, the configuration file or any
+additional files inside the Docker image. You can still mount them while
+running Docker. Here are few examples:
+
+### With a configuration file
+
+```sh
+docker run -p 80:80 -v $(pwd)/config.php:/var/www/html/config.php -v gmazoyer/looking-glass:latest
+```
+
+### With a custom CSS and logo
+
+```sh
+docker run -p 80:80 -v $(pwd)/config.php:/var/www/html/config.php -v $(pwd)/mystyle.css:/var/www/html/css/mystyle.css gmazoyer/looking-glass:latest
+```