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

update doc docker #231

Merged
merged 5 commits into from
Oct 31, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
245 changes: 57 additions & 188 deletions en/installation_guide/install_with_docker_for_contributors.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Install OpenOrchestra with Docker for contributors
===================================================
==================================================

Open Orchestra is composed of three projects:

Expand All @@ -11,176 +11,97 @@ Open Orchestra is composed of three projects:
For contributors, we provide a Docker environment so you get minimal
setup actions to do.

Install Virtualbox (for MacOS and Windows)
------------------------------------------

Mac OS

- download http://download.virtualbox.org/virtualbox/4.3.20/VirtualBox-4.3.20-96996-OSX.dmg

Windows

- download http://download.virtualbox.org/virtualbox/4.3.20/VirtualBox-4.3.20-96997-Win.exe

Install Docker
---------------
The project is running in a virtual environment to be production ready.

### Linux ###

.. code-block:: bash

$ sudo apt-get update
$ sudo apt-get install wget
$ sudo apt-get install curl
$ wget -qO- https://get.docker.com/ | sh

Note: If your company is behind a filtering proxy, you may find that the apt-key command fails for the Docker repository during installation. To work around this, add the key directly using the following:

.. code-block:: bash

$ wget -qO- https://get.docker.com/gpg | sudo apt-key add -

Create docker group

.. code-block:: bash

$ sudo usermod -aG docker ubuntu

Install docker compose

.. code-block:: bash

$ curl -L https://github.com/docker/compose/releases/download/1.5.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
$ chmod +x /usr/local/bin/docker-compose

### Mac OS ###

.. code-block:: text

download https://www.docker.com/docker-toolbox (mac version)
install the package
open a terminal (e.g. http://cmder.net/)

type the commands

.. code-block:: bash

$ docker-machine create default --driver=virtualbox
$ eval $(docker-machine env default)

### Windows ###

.. code-block:: text

download https://www.docker.com/docker-toolbox (mac version)
install the package
open a terminal (e.g. http://cmder.net/)

type the commands

.. code-block:: bash

$ docker-machine create default --driver=virtualbox
$ eval $(docker-machine env default)

Download Composer
-----------------

Composer is the package manager used by modern PHP applications.

To install composer with curl:
--------------

.. code-block:: bash
Install of Open Orchestra with docker require `Compose 1.6.0+` and `Docker Engine 1.10.+`.

$ curl -sS https://getcomposer.org/installer | php
- Install Docker for `Linux <https://docs.docker.com/engine/installation/linux/>`_
- Install Docker for `Mac <https://docs.docker.com/docker-for-mac/>`_
- Install Docker for `Windows <https://docs.docker.com/docker-for-windows/>`_

If you don't have curl installed, you can also download it with PHP:

.. code-block:: bash

$ php -r "readfile('https://getcomposer.org/installer');" | php

see `Download Composer`_

Install OpenOrchestra
---------------------

First of all, you have to clone the Open Orchestra Docker repository:
Clone the Open Orchestra applications repository and Docker repositories in the same folder:

.. code-block:: bash

$ cd <your_project_folder>/
Copy link
Contributor

@aloupfor aloupfor Sep 6, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked at the full file with the rst rendering and it looks like this code-block isn't shown.
I think you have to keep an empty line beetween .. code-block:: bash and the first line of code (here : $ cd <your_project_folder>/).

So, empty line missing (?).

$ git clone git@github.com:open-orchestra/open-orchestra-provision-docker.git
$ git clone git@github.com:open-orchestra/open-orchestra.git
$ git clone git@github.com:open-orchestra/open-orchestra-front-demo.git
$ git clone git@github.com:open-orchestra/open-orchestra-media-demo.git
$ mkdir uploaded-files

Build Docker containers:

To contribute to the project a script can install two versions: the master version and the last stable one. The master branch is the branch which should be used to add new features to the project.
Here is the directory tree with your two projects:
.. code-block:: bash

.. code-block:: none
$ cd <your_project_folder>/open-orchestra-provision-docker/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

empty line missing (?).

$ docker-compose up -d

|_ open-orchestra-provision-docker
|_ open-orchestra-master
|_ open-orchestra
|_ open-orchestra-front-demo
|_ open-orchestra-media-demo
|_ open-orchestra-provision
|_ open-orchestra-stable
|_ open-orchestra
|_ open-orchestra-front-demo
|_ open-orchestra-media-demo
|_ open-orchestra-provision

1. Easy way
Install applications:

You can run all the commands below with one script :
Back Office:

.. code-block:: bash

$ ./install.sh master
or
$ ./install.sh stable

2. Manual way
$ cd <your_project_folder>/open-orchestra-provision-docker/
$ docker exec -it -u www-data oo_apache_php /bin/bash
$ cd /var/www/openorchestra/ && composer install #install vendors

When to complete the application settings, use these parameters (use default value for other)

.. code-block:: yaml

To install the master open-orchestra parts using ``composer``:
open_orchestra_cms.mongodb.host: oo_mongo
fos_http_cache.proxy_client.varnish.servers: [oo_varnish:6081]
host_elastica: oo_elasticsearch
media.directory: /var/www/uploaded-files

In your ``open-orchestra-master`` directory:

.. code-block:: bash

$ [path-to-composer]/composer.phar create-project open-orchestra/open-orchestra ./open-orchestra -s dev --ignore-platform-reqs --no-scripts --keep-vcs dev-master
$ [path-to-composer]/composer.phar create-project open-orchestra/open-orchestra-front-demo ./open-orchestra-front-demo -s dev --ignore-platform-reqs --no-scripts --keep-vcs dev-master
$ [path-to-composer]/composer.phar create-project open-orchestra/open-orchestra-media-demo ./open-orchestra-media-demo -s dev --ignore-platform-reqs --no-scripts --keep-vcs dev-master
$ ./bin/grunt #install assets
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

empty line missing (?).

$ app/console orchestra:mongo:fixtures:load --env=prod --type=all #load fixtures
$ exit

Build Docker containers :
Front Office:

.. code-block:: bash

$ docker-compose -f docker-compose.yml -f docker-compose-master.yml up -d
$ cd <your_project_folder>/open-orchestra-provision-docker/
$ docker exec -it -u www-data oo_apache_php /bin/bash
$ cd /var/www/front-openorchestra/ && composer install
$ app/console assets:install
$ exit

- To install the stable open-orchestra parts using ``composer``:
When to complete the application settings, use these parameters (use default value for other)

In your ``open-orchestra-stable`` directory:

.. code-block:: bash
.. code-block:: yaml

$ [path-to-composer]/composer.phar create-project open-orchestra/open-orchestra ./open-orchestra -s stable --ignore-platform-reqs --no-scripts --keep-vcs
$ [path-to-composer]/composer.phar create-project open-orchestra/open-orchestra-front-demo ./open-orchestra-front-demo -s stable --ignore-platform-reqs --no-scripts --keep-vcs
$ [path-to-composer]/composer.phar create-project open-orchestra/open-orchestra-media-demo ./open-orchestra-media-demo -s stable --ignore-platform-reqs --no-scripts --keep-vcs
open_orchestra_cms.mongodb.server: 'mongodb://oo_mongo:27017'
fos_http_cache.proxy_client.varnish.servers: [oo_varnish:6081]
host_elastica: oo_elasticsearch

Build Docker containers :
Media:

.. code-block:: bash

$ docker-compose -f docker-compose.yml -f docker-compose-stable.yml up -d
$ cd <your_project_folder>/open-orchestra-provision-docker/
$ docker exec -it -u www-data oo_apache_php /bin/bash
$ cd /var/www/media-openorchestra/ && composer install
$ exit

When to complete the application settings, use these parameters (use default value for other)

Parameters to define at the end of composer install
---------------------------------------------------
.. code-block:: yaml

.. code-block:: yaml
media.directory: /var/www/uploaded-files

open_orchestra_cms.mongodb.host : mongo
fos_http_cache.proxy_client.varnish.servers : [varnish:6081]
host_elastica : elastica

Override the DNS redirections
-----------------------------
Expand All @@ -190,60 +111,8 @@ In the ``/etc/hosts`` file of your computer add the following lines:
[IP] must be replaced by 127.0.0.1 for Linux
[IP] must be replaced by the value gived by the command ``docker-machine ip default``

.. code-block:: text

[IP] admin.openorchestra.dev
[IP] demo.openorchestra.dev
[IP] media.openorchestra.dev
[IP] admin.openorchestra.stable
[IP] demo.openorchestra.stable
[IP] media.openorchestra.stable

You should follow the same steps to install each versions :

* Run the containers
* Install the assets
* Load the fixtures

Run the init script
-------------------

To finish the insytallation, you must launch an init script inside the main container by using this command:

.. code-block:: bash

$ docker exec -it app_open_orchestra_master /load.sh
or
$ docker exec -it app_open_orchestra_stable /load.sh

It will take some time to:

* prepare the cache and logs directories inside the App container
* NPM Install (it's the longer process of the procedure)
* Composer install
* Load fixtures
* Create ElasticSearch Indexes and populate data
* Launch Grunt to install the assets


Result
------

Master version
~~~~~~~~~~~~~~

You can log on http://admin.openorchestra.dev/app_dev.php/login with username=admin and
password=admin for the CMS and see the result on http://demo.openorchestra.dev/app_dev.php.

All the images will be visible on the http://media.openorchestra.dev/app_dev.php url.

Stable version
~~~~~~~~~~~~~~

You can log on http://admin.openorchestra.stable/app_dev.php/login with username=admin and
password=admin for the CMS and see the result on http://demo.openorchestra.stable/app_dev.php.

All the images will be visible on the http://media.openorchestra.stable/app_dev.php url.

.. _`Download Composer`: https://getcomposer.org/download/
.. code-block:: text

[IP] admin.openorchestra.dev
[IP] demo.openorchestra.dev
[IP] media.openorchestra.dev