Installation in development mode¶
Get the code¶
Clone or download the chill-standard project and cd into the main directory.
git clone https://framasoft.org/Chill-project/Chill-Standard.git cd Chill-Standard
As a developer, the code will stay on your computer and will be executed in docker container. To avoid permission problem, the code should be run with the same uid/gid from your current user. This is why we get your current user id with the command
id -u in each following scripts.
Prepare your variables¶
Have a look at the variable in
env.dist and in
app/config/parameters.yml.dist and check if you need to adapt them. If they do not adapt with your need, or if some are missing:
- copy the file as
cp env.dist .env
- replace the variable inside
- copy the file
cp app/config/parameters.yml.dist app/config/parameters
- replace eventually the variable inside this file
Note: If you intend to use the bundle
Chill-Doc-Store, you will need to configure and install an openstack object storage container with temporary url middleware. You will have to configure secret keys.
Run the bootstrap script¶
This script can be run using make
This script will :
- force docker-compose to, eventually, pull the base images and build the image used by this project ;
- run an install script to download composer ;
- install the php dependencies
run those commands:
Start the project¶
On the first run (and after each upgrade), you must execute post update commands and run database migrations. With a container up and running, execute the following commands:
docker-compose exec --user $(id -u) php app/console doctrine:migrations:migrate
Chill will be available at
http://localhost:8001. Currently, there isn’t any user or data. To add fixtures, run
docker-compose exec --user $(id -u) php app/console doctrine:fixtures:load
There are several users available:
The password is always
Now, read the how-tos.
How to execute the console ?¶
# if a container is running docker-compose exec --user $(id -u) php app/console # if not docker-compose run --user $(id -u) php app/console
How to create the database schema (= run migrations) ?¶
# if a container is running docker-compose exec --user $(id -u) php app/console doctrine:migrations:migrate # if not docker-compose run --user $(id -u) php app/console doctrine:migrations:migrate
How to read the email sent by the program ?¶
http://localhost:8005 and you should have access to mailcatcher.
In case of you should click on a link in the email, be aware that you should remove the “s” from https.
How to load fixtures ? (development mode only)¶
# if a container is running docker-compose exec --user $(id -u) php app/console doctrine:fixtures:load # if not docker-compose run --user $(id -u) php app/console doctrine:fixtures:load
How to open a terminal in the project¶
# if a container is running docker-compose exec --user $(id -u) php /bin/bash # if not docker-compose run --user $(id -u) php /bin/bash
How to run composer ?¶
# if a container is running docker-compose exec --user $(id -u) php ./composer.phar # if not docker-compose run --user $(id -u) php ./composer.phar
How to access to PGADMIN ?¶
Pgadmin is installed with docker-compose.
You can access it at
- login: email@example.com
- password: password
How to run tests ?¶
Tests reside inside the installed bundles. You must cd into that directory, download the required packages, and execute them from this place.
Note: some bundle require the fixture to be executed. See the dedicated _how-tos_.
Exemple, for running test inside main bundle:
# mount into the php image docker-compose run --user $(id -u) php /bin/bash # cd into main directory cd vendor/chill-project/main # download deps php ../../../composer.phar install # run tests /vendor/bin/phpunit
How to run webpack interactively¶
bash docker-node.sh will open a terminal in a node container, with volumes mounted.
Build the documentation API¶
A basic configuration of sami is embedded within the project.
A configuration file for phpDocumentor is present.
Error An exception has been thrown during the rendering of a template (“Asset manifest file “/var/www/app/web/build/manifest.json” does not exist.”). on first run¶
Running in production¶
Currently, to run this software in production, the state of the art is the following :
Run the software locally and tweak the configuration to your needs ;
Build the image and store them into a private container registry. This can be done using
To be sure to target the correct container registry, you have to adapt the values
IMAGE_PHPdate in the
Run the image on your production server, using docker-compose or eventually docker stack. You have to customize the variable set in docker-compose.
See also the Tips and tricks below.
In production, you must set those variables:
There are security issues if you keep the same variable than for production.
Tips and tricks¶
Operation on database (backups, running custom sql, replication) are easier to set when run outside of a container. If you run into a container, take care of the volume where data are stored.
The PHP sessions are stored inside redis. This is useful if you distribute the traffic amongst different php server: they will share same sessions if a request goes into a different instance of the container.
When the PHP servers are shared across multiple instances, take care that some data is stored into redis: the same redis server should be reachable by all instances.
It is worth having an eye on the configuration of logstash container.
Why the DB URL is set in environment, and not in parameters.yml ?¶
Because, at startup, a script does check the db is up and, if not, wait for a couple of seconds before running
entrypoint.sh. For avoiding double configuration, the configuration of the PHP app takes his configuration from environment also (and it will be standard in future releases, with symfony 4.0).