Step-by-step installation on Docker
===================================

This installation method being very new to PiAnoS, the git repo is NOT STABLE. A lot of changes are pushed to this repo, including history rewriting (with force-push). This installation should only be used, for the moment, as developement plateforme. In a near future, this repo will be stable.

Install Docker
--------------

This installation process of Docker is well documented online. The installation can be done very easely with one of the following command:

.. code-block:: bash

    $ wget -qO- https://get.docker.com/ | sh

In a second step, you have to install docker-compose with the following commands:

.. code-block:: bash
	
	$ sudo curl -L https://github.com/docker/compose/releases/download/1.16.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
	$ sudo chmod +x /usr/local/bin/docker-compose

See the |dockerinstalldoc| and |dockercomposedoc| for more details.

Download the PiAnoS image
-------------------------

The PiAnoS image can be downloaded and run directly with the following command:

.. code-block:: bash

	$ curl -sSL http://ips-labs.unil.ch:1337/PiAnoS/docker/raw/develop/get.sh | sh	

which is equivalement of the following commands:

.. code-block:: bash

	$ git clone --recursive http://ips-labs.unil.ch:1337/PiAnoS/docker .
	$ git checkout -b develop origin/develop
	$ git submodule update
	$ docker-compose up --build

Please see the content of the installation script (|getpianos|) for more details.

A link for all versions will be available in a need future. If you need a particular version of PiAnoS, simple ``git checkout`` the right commit, and ``docker-compose up`` the directory.

Configuration
-------------

The configuration of the PiAnoS instance can be done in the configuration file present in the Docker folder, regarding the "system" configuration, and in the PiAnoS backend/settings.php file regarding the PiAnoS configration.

The configuration files will be located in the `config` folder in a near future.

Run the image
-------------

To run the PiAnoS, use the Makefile command:

.. code-block:: bash

    $ make up

If you have any bind problems, check if you have any docker image alreay up and running with the :

.. code-block:: bash

	$ docker ps

command. If so, you can remove all running images with the following command:

.. code-block:: bash

	$ docker rm -f $(docker ps -aq)

..
	Links

.. |dockerinstalldoc| raw:: html

	<a href="https://docs.docker.com/engine/installation/" target="_blank">Docker installation documentation</a>

.. |dockercomposedoc| raw:: html

	<a href="https://docs.docker.com/compose/install/#install-compose" target="_blank">Docker-compose installation documentation</a>

.. |getpianos| raw:: html

	<a href="http://ips-labs.unil.ch:1337/PiAnoS/docker/raw/develop/get.sh" target="_blank">Get PiAnoS</a>
