mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-01 20:43:49 +00:00
improve installation with docker and move static to _static
This commit is contained in:
@@ -12,23 +12,16 @@
|
||||
Free Documentation License".
|
||||
|
||||
Installation
|
||||
###############################
|
||||
#############
|
||||
|
||||
Canonical installation
|
||||
======================
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
Common installation <installation.rst>
|
||||
|
||||
Very quick install with docker
|
||||
=================================
|
||||
Install with docker
|
||||
===================
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
Very quick install with docker <very_quick_start_with_docker.rst>
|
||||
Install with docker <install_with_docker.rst>
|
||||
|
||||
Usage in production
|
||||
====================
|
||||
@@ -37,6 +30,14 @@ Usage in production
|
||||
:maxdepth: 2
|
||||
|
||||
Installation in production <install_production_webserver.rst>
|
||||
|
||||
Installation without docker
|
||||
===========================
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
Common installation <installation_without_docker.rst>
|
||||
|
||||
Update Chill and maintenance
|
||||
==============================
|
||||
|
80
source/installation/install_with_docker.rst
Normal file
80
source/installation/install_with_docker.rst
Normal file
@@ -0,0 +1,80 @@
|
||||
.. Copyright (C) 2014 Champs Libres Cooperative SCRLFS
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3
|
||||
or any later version published by the Free Software Foundation;
|
||||
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
|
||||
A copy of the license is included in the section entitled "GNU
|
||||
Free Documentation License".
|
||||
|
||||
Install with docker
|
||||
####################
|
||||
|
||||
The installation with docker is the canonical way to install Chill in production.
|
||||
|
||||
Availables images and flavors
|
||||
=============================
|
||||
|
||||
We provide docker images which here : https://hub.docker.com/r/chill/standard/
|
||||
|
||||
There are differents "flavors" of docker, depending on which bundles are installed. Those flavors are available as tags, which are named according to bundles'names, with a prefix for the stable or dev versions. Those flavors are listed here : https://hub.docker.com/r/chill/standard/tags/.
|
||||
|
||||
|
||||
How to install
|
||||
==============
|
||||
|
||||
Prerequisites
|
||||
-------------
|
||||
|
||||
Make sure you have installed ``docker`` and ``docker-compose`` installed.
|
||||
|
||||
|
||||
Create your ``docker-compose`` project
|
||||
--------------------------------------
|
||||
|
||||
1. Create an empty working directory (``mkdir chill && cd chill``)
|
||||
2. Download or copy-paste the above :download:`docker-compose.yml file </_static/code/installation/docker-compose.yml>`
|
||||
|
||||
.. literalinclude:: /_static/code/installation/docker-compose.yml
|
||||
:language: yaml
|
||||
|
||||
3. Adapt eventually the image with your own requested flavor.
|
||||
4. Download or copy-paster the above :download:`nginx.conf file </_static/code/installation/nginx.conf>`. This file must be located in the same directory of your ``docker-compose.yml`` file.
|
||||
|
||||
.. literalinclude:: /_static/code/installation/nginx.conf
|
||||
:language: nginx
|
||||
|
||||
5. Launch the stack with ``docker-compose up``. Docker and docker-compose will download the container images, create an internal network and create the database schema.
|
||||
6. Browse http://localhost:8080, you are ready to start !
|
||||
|
||||
To stop the container, you can type ``CTRL+C`` in the terminal to stop container **OR** run ``docker-compose stop`` in a separate terminal.
|
||||
|
||||
On startup, you will only have access to the admin user: login ``admin``, password ``admin`` (as defined in ``docker-compose.yml`` file, under an environment variabled called ``ADMIN_PASSWORD``.
|
||||
|
||||
Create fixtures (more user and fake data)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
You can create fixtures using the command ``docker-compose exec fpm php -d memory_limit=-1 doctrine:fixtures:load``.
|
||||
|
||||
This will create those users, which password is always ``password``:
|
||||
|
||||
* center a_social
|
||||
* center a_administrative
|
||||
* center a_direction
|
||||
* center b_social
|
||||
* center b_administrative
|
||||
* center b_direction
|
||||
* multi_center
|
||||
|
||||
Create your own images
|
||||
======================
|
||||
|
||||
You can create your own images, compile yourself and adapt the flavors to your needs. The source of the docker images are available here : https://framagit.org/Chill-project/docker-standard
|
||||
|
||||
|
||||
.. _the composer documentation: https://getcomposer.org/doc/
|
||||
.. _the composer introduction: https://getcomposer.org/doc/00-intro.md
|
||||
.. _the standard architecture: https://github.com/Champs-Libres/chill-standard
|
||||
.. _composer: https://getcomposer.org
|
||||
.. _Firefox: https://www.mozilla.org
|
||||
.. _symfony framework: http://symfony.com
|
||||
.. _*unaccent* extension: http://www.postgresql.org/docs/current/static/unaccent.html
|
@@ -6,14 +6,11 @@
|
||||
A copy of the license is included in the section entitled "GNU
|
||||
Free Documentation License".
|
||||
|
||||
.. _install:
|
||||
|
||||
Install chill
|
||||
#############
|
||||
Install chill without docker
|
||||
############################
|
||||
|
||||
|
||||
.. _basic-installation:
|
||||
|
||||
Basic installation
|
||||
``````````````````
|
||||
|
||||
@@ -45,34 +42,17 @@ Install composer
|
||||
.. note::
|
||||
If you do not know composer, it is a good idea to have a glance at `the composer documentation`_
|
||||
|
||||
Install composer on your system :
|
||||
Install composer on your system, according to the instructions here : https://getcomposer.org/download
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
curl -sS https://getcomposer.org/installer | php
|
||||
|
||||
Install composer.phar globally
|
||||
""""""""""""""""""""""""""""""
|
||||
|
||||
.. note::
|
||||
This part is not mandatory, if you do not want to install composer globally, you will have to replace in the commands of this tutorial `composer` by `php composer.phar`.
|
||||
|
||||
Install composer globally on you system will made the installation process easier. To do this, simply run
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
sudo mv composer.phar /usr/local/bin/composer
|
||||
sudo chmod +x /usr/local/bin/composer
|
||||
|
||||
You can test the installation by running `which composer` or `composer`: those command should not raise any error.
|
||||
|
||||
.. note::
|
||||
See `the composer introduction`_ to learn how to install composer on Mac OS X and Windows
|
||||
|
||||
The docker database
|
||||
"""""""""""""""""""
|
||||
Install a database
|
||||
""""""""""""""""""
|
||||
|
||||
Let's continue now by installing and configuring the docker database.
|
||||
|
||||
.. note::
|
||||
If you do not want install a database with docker, you should create a postgresql database manually on your system, and add the extension ``UNACCENT``: ``CREATE EXTENSION "unaccent"``.
|
||||
|
||||
|
||||
You will find all details concerning the installation of docker on their official site looking for your OS into the menu `Install/Docker Engine <http://docs.docker.com/>`_.
|
||||
|
||||
Once docker is installed, run :
|
@@ -1,114 +0,0 @@
|
||||
.. Copyright (C) 2014 Champs Libres Cooperative SCRLFS
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3
|
||||
or any later version published by the Free Software Foundation;
|
||||
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
|
||||
A copy of the license is included in the section entitled "GNU
|
||||
Free Documentation License".
|
||||
|
||||
Very quick start with docker
|
||||
#############################
|
||||
|
||||
|
||||
.. _quick-start-with-docker:
|
||||
|
||||
We have created a `docker container <https://hub.docker.com/r/chill/demo-flavor/>`_ to let you test `Chill` easily.
|
||||
|
||||
.. note::
|
||||
|
||||
We assume docker is already installed on your machine. If Docker is not installed, have a look at `the install page in the docker documentation <https://docs.docker.com/>`_.
|
||||
|
||||
Starting the containers
|
||||
========================
|
||||
|
||||
Mac OS X & docker
|
||||
-----------------
|
||||
|
||||
To use docker on Mac OS X you need to use `boot2docker` or `docker-machine`
|
||||
|
||||
Configuration of `boot2docker`
|
||||
``````````````````````````````
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ boot2docker start
|
||||
$ boot2docker shellinit
|
||||
|
||||
|
||||
Configuration of `docker-machine`
|
||||
`````````````````````````````````
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ docker-machine start default
|
||||
$ eval "$(docker-machine env default)"
|
||||
|
||||
|
||||
Getting the last version of the docker images
|
||||
----------------------------------------------
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
docker pull chill/database
|
||||
docker pull chill/demo-flavor
|
||||
|
||||
|
||||
Prepare a database
|
||||
------------------
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
docker run --rm --name=chill_database chill/database
|
||||
|
||||
The first time you will run this command, the image will be downloaded from docker registry. Please be patient.
|
||||
|
||||
Run the container containing the code and attach it to the database
|
||||
-------------------------------------------------------------------
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
docker run --rm --link chill_database:db -p 8989:8000 --name=chill_php chill/demo-flavor
|
||||
|
||||
The image will also be downloaded from docker registry on first run.
|
||||
|
||||
You can then browse on `http://localhost:8989 <http://localhost:8989>`_ and login with the created users, like `center a_social` (the complete list is below). Password is always 'password'. For Mac OS X, replace `localhost` by the IP of the docker VM (`boot2docker ip` or `docker-machine ip default`).
|
||||
|
||||
Stopping the containers
|
||||
=======================
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
docker stop chill_php
|
||||
docker stop chill_database
|
||||
|
||||
Limitations
|
||||
============
|
||||
|
||||
* Those container should not be used in production
|
||||
* The database should not be persisted or store persistant information: at each container startup, the container's data will be erased and replaced by new (partially) random fixtures
|
||||
|
||||
Users created
|
||||
==============
|
||||
|
||||
The passwords are always `password` :
|
||||
|
||||
The user's login created are :
|
||||
|
||||
* center a_social
|
||||
* center a_administrative
|
||||
* center a_direction
|
||||
* center b_social
|
||||
* center b_administrative
|
||||
* center b_direction
|
||||
* multi_center
|
||||
* admin
|
||||
|
||||
|
||||
|
||||
.. _the composer documentation: https://getcomposer.org/doc/
|
||||
.. _the composer introduction: https://getcomposer.org/doc/00-intro.md
|
||||
.. _the standard architecture: https://github.com/Champs-Libres/chill-standard
|
||||
.. _composer: https://getcomposer.org
|
||||
.. _Firefox: https://www.mozilla.org
|
||||
.. _symfony framework: http://symfony.com
|
||||
.. _*unaccent* extension: http://www.postgresql.org/docs/current/static/unaccent.html
|
Reference in New Issue
Block a user