diff options
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | docs/docker.md | 37 |
2 files changed, 30 insertions, 9 deletions
@@ -43,7 +43,7 @@ glass. Details about configuration options are available in the ## 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 +is provided in this repository. More details can be found [here](docs/docker.md). ## Documentation diff --git a/docs/docker.md b/docs/docker.md index a65afa2..f6bea37 100644 --- a/docs/docker.md +++ b/docs/docker.md @@ -8,24 +8,24 @@ create your own to match your need. 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 +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. +`docker pull gmazoyer/looking-glass` and you'll get the latest. 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). +webserver that is comfortable with interpreting PHP files. You can track +down PHP versions comptaibility +[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: +running Docker. Below you'll find examples that expose the looking glass on +the port 80 of the host. ### With a configuration file @@ -38,3 +38,24 @@ docker run -p 80:80 -v $(pwd)/config.php:/var/www/html/config.php gmazoyer/looki ```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 ``` + +## Running this Docker + +If you need to automatically run the Docker container at the host startup you +can write a new service. With systemd it is pretty simple to do, here is an +example supposing the container has already been created and is named +"looking-glass": +``` +[Unit] +Description=Looking Glass container +Requires=docker.service +After=docker.service + +[Service] +Restart=always +ExecStart=/usr/bin/docker start -a looking-glass +ExecStop=/usr/bin/docker stop -t 2 looking-glass + +[Install] +WantedBy=default.target +``` |