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 docker-compose.yml file
version: '2'
services:
  fpm:
    image: dev-activity-person-report
    links:
      - db
      - redis
      - logstash:gelf
    environment:
      - ADMIN_PASSWORD=admin
# add a link to custom.yml if needed
#    volumes:
#      - /tmp/custom.yml:/var/www/chill/app/config/custom.yml
  redis:
    image: redis
  db:
    image: chill/database
  logstash:
    image: logstash
    command: logstash -e 'input { gelf { } } output {  stdout{ } }'
    expose:
      - "12201/udp"
    volumes:
      - /var/log/logstash
  nginx:
    image: nginx
    links:
      - fpm
    volumes: 
      - ./nginx.conf:/etc/nginx/nginx.conf
    volumes_from:
      - fpm:ro
    ports:
      - 8080:80
  1. Adapt eventually the image with your own requested flavor.
  2. Download or copy-paster the above nginx.conf file. This file must be located in the same directory of your docker-compose.yml file.
user  nginx;
worker_processes  1;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}




http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;
    error_log   /var/log/nginx/error.log;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    gzip  off;

    #include /etc/nginx/conf.d/*.conf;

upstream phpfcgi {
    server fpm:9000;
    # server unix:/var/run/php5-fpm.sock; #for PHP-FPM running on UNIX socket
}

server {
    listen 80;

    #server_name symfony2;
    root /var/www/chill/web;

    error_log /var/log/nginx/symfony2.error.log;
    access_log /var/log/nginx/symfony2.access.log;

    # strip app.php/ prefix if it is present
    rewrite ^/app\.php/?(.*)$ /$1 permanent;

    location / {
        index app.php;
        try_files $uri @rewriteapp;
    }

    location @rewriteapp {
        rewrite ^(.*)$ /app.php/$1 last;
    }

    # pass the PHP scripts to FastCGI server from upstream phpfcgi
    location ~ ^/(app|app_dev|config)\.php(/|$) {
        fastcgi_pass phpfcgi;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include fastcgi_params;
        fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param  HTTPS off;
    }
}
}
  1. 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.
  2. 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