diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 439e9abae1dab9dc0c8a6bfca2b63a1e6fcda1bf..bb8c0c12d314a4a23d8beb58e990ad96fa1a8def 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,21 +1,91 @@
-image: framasoft/framadate-ci
+variables:
+  TESTING_IMAGE: framasoft/framadate-ci:php-7.2
+
+image: ${TESTING_IMAGE}
+
+cache:
+  key: "${TESTING_IMAGE}:${CI_PROJECT_ID}"
+  paths:
+    - vendor/
+
+before_script:
+  - composer install -o  --no-interaction --no-progress --prefer-dist
+
 stages:
   - test
   - deploy
   - beta
   - funky
 
-# Run php-cs-fixer and phpunit on all branches
+# Run phpunit on all branches
 test:
   stage: test
   script:
-    - composer install -o  --no-interaction --no-progress --prefer-dist
-    - php vendor/bin/php-cs-fixer fix --verbose --dry-run
-    - APP_ENV=test bin/doctrine migrations:migrate --no-interaction -vvv
     - vendor/bin/phpunit --bootstrap app/tests/bootstrap.php --debug app/tests
-  cache:
-    paths:
-      - vendor/
+
+# Run php-cs-fixer on all branches
+lint:
+  stage: test
+  script:
+    - php vendor/bin/php-cs-fixer fix --verbose --dry-run
+
+# Run doctrine migrations with MySQL
+.db:migration:mysql:
+  stage: test
+  variables:
+    APP_ENV: "test"
+    MYSQL_DATABASE: "fd_test"
+    MYSQL_ROOT_PASSWORD: "coucou"
+    FRAMADATE_DB_DRIVER: 'pdo_mysql'
+    FRAMADATE_DB_HOST: "mysql"
+    FRAMADATE_DB_NAME: "${MYSQL_DATABASE}"
+    FRAMADATE_DB_USER: "root"
+    FRAMADATE_DB_PASSWORD: "${MYSQL_ROOT_PASSWORD}"
+  script:
+    - docker-php-ext-install "${FRAMADATE_DB_DRIVER}"
+    - bin/doctrine migrations:status -vvv
+    - bin/doctrine migrations:migrate --no-interaction -vvv
+    - bin/doctrine migrations:status -vvv
+
+db:migration:mysql:5.6:
+  extends: .db:migration:mysql
+  services:
+    - 'mysql:5.6'
+
+db:migration:mysql:5.7:
+  extends: .db:migration:mysql
+  services:
+    - 'mysql:5.7'
+
+db:migration:mysql:8:
+  extends: .db:migration:mysql
+  services:
+    - name: 'mysql:8'
+      command: ['--default-authentication-plugin=mysql_native_password']
+
+# Run doctrine migrations with PostgreSQL
+.db:migration:postgresql:
+  stage: test
+  variables:
+    APP_ENV: "test"
+    POSTGRES_DB: "fd_test"
+    POSTGRES_USER: "marmotte"
+    POSTGRES_PASSWORD: "sleeping"
+    FRAMADATE_DB_DRIVER: 'pdo_pgsql'
+    FRAMADATE_DB_HOST: "postgres"
+    FRAMADATE_DB_NAME: "${POSTGRES_DB}"
+    FRAMADATE_DB_USER: "${POSTGRES_USER}"
+    FRAMADATE_DB_PASSWORD: "${POSTGRES_PASSWORD}"
+  script:
+    - docker-php-ext-install "${FRAMADATE_DB_DRIVER}"
+    - bin/doctrine migrations:status -vvv
+    - bin/doctrine migrations:migrate --no-interaction -vvv
+    - bin/doctrine migrations:status -vvv
+
+db:migration:postgresql:9.6:
+  extends: .db:migration:postgresql
+  services:
+    - 'postgres:9.6'
 
 check:missing:trads:
   stage: test
@@ -65,7 +135,6 @@ pages:
 beta:
   stage: beta
   script:
-  - git checkout develop
   - composer install -o  --no-interaction --no-progress --prefer-dist --no-dev
   - composer dump-autoload --optimize --no-dev --classmap-authoritative
 #   - if [ ! -z ${ZANATA_CONFIG_FRAMABOT+x} ]; then mkdir -p ${HOME}/.config; echo -e "${ZANATA_CONFIG_FRAMABOT}" > ${HOME}/.config/zanata.ini; fi
@@ -87,7 +156,6 @@ beta:
 funky:
   stage: funky
   script:
-  - git checkout funky
   - composer install
   - mkdir tpl_c
   - mkdir .public
diff --git a/README.md b/README.md
index 8c8b24559f4090bab397347c042b82260d4d3c54..de315d6b9c61770ac4070177e3c0fbf2c1851004 100644
--- a/README.md
+++ b/README.md
@@ -23,7 +23,7 @@ Follow the instructions on <https://framagit.org/framasoft/framadate/framadate/w
 * PHP [PHP 5.6](http://php.net)
 * Templating [Smarty](http://www.smarty.net/),
 * I18N [o80-i18n](https://github.com/olivierperez/o80-i18n)
-* Database: PostgreSQL ou [MySQL 5.5](https://dev.mysql.com/downloads/mysql/5.5.html)
+* Database: PostgreSQL 9.6 or [MySQL 5.6+](https://dev.mysql.com/downloads/mysql/5.6.html)/[MariaDB 10.1+](https://www.debian.org/releases/stable/mips/release-notes/ch-whats-new.en.html#mariadb-replaces-mysql)
 
 ---
 
diff --git a/app/classes/Framadate/Migrations/Version20151012082600.php b/app/classes/Framadate/Migrations/Version20151012082600.php
index 919b0ba8012beb0317a2f1dffe96ea6f19cb0f2f..a4896ebf4eef530814bb4ae7db13b4afb6dd6aef 100644
--- a/app/classes/Framadate/Migrations/Version20151012082600.php
+++ b/app/classes/Framadate/Migrations/Version20151012082600.php
@@ -53,6 +53,10 @@ class Version20151012082600 extends AbstractMigration
 
         $this->skipIf($commentTable->hasColumn('date'), 'Column date in comment table already exists');
 
+        // The default for datetime types is only available for MySQL 5.6
+        // See the "Functionality Added or Changed" section,
+        // "Important Change: In MySQL, the TIMESTAMP data type" element, on
+        // https://dev.mysql.com/doc/relnotes/mysql/5.6/en/news-5-6-6.html
         $commentTable->addColumn('date', 'datetime', ['default' => 0]);
     }
 
diff --git a/app/inc/config.test.php b/app/inc/config.test.php
index c642b2ddb04434e7533f22ba43cb948aac27882a..5a1efff69b6045d55a15f2225232e9874427e345 100644
--- a/app/inc/config.test.php
+++ b/app/inc/config.test.php
@@ -32,22 +32,22 @@ const ADRESSEMAILADMIN = 'admin@app.tld';
 const ADRESSEMAILREPONSEAUTO = 'no@reply';
 
 // Database driver
-const DB_DRIVER = 'pdo_sqlite';
+const DB_DRIVER = FRAMADATE_DB_DRIVER;
 
 // Database name
-const DB_NAME = 'framadate';
+const DB_NAME = FRAMADATE_DB_NAME;
 
 // Database host
-const DB_HOST = '';
+const DB_HOST = FRAMADATE_DB_HOST;
 
 // Database port
-const DB_PORT = '';
+const DB_PORT = FRAMADATE_DB_PORT;
 
 // Database user
-const DB_USER = '';
+const DB_USER = FRAMADATE_DB_USER;
 
 // Database password
-const DB_PASSWORD = '';
+const DB_PASSWORD = FRAMADATE_DB_PASSWORD;
 
 // Table name prefix
 const TABLENAME_PREFIX = 'fd_';
diff --git a/app/inc/init.php b/app/inc/init.php
index ed973bec88b15fb6a868f61b87ca0e4869731136..47a7bd739c7556599679afcf4731aab4d5bf7901 100644
--- a/app/inc/init.php
+++ b/app/inc/init.php
@@ -40,6 +40,13 @@ define('ROOT_DIR', __DIR__ . '/../../');
 $path = '/app/inc/config.php';
 if (getenv('APP_ENV') === 'test') {
     $path = '/app/inc/config.test.php';
+    // Read DB connection params from Environment Variables if possible
+    define('FRAMADATE_DB_DRIVER', getenv('FRAMADATE_DB_DRIVER') ? getenv('FRAMADATE_DB_DRIVER') : 'pdo_sqlite');
+    define('FRAMADATE_DB_NAME', getenv('FRAMADATE_DB_NAME') ? getenv('FRAMADATE_DB_NAME') : 'framadate');
+    define('FRAMADATE_DB_HOST', getenv('FRAMADATE_DB_HOST') ? getenv('FRAMADATE_DB_HOST') : '');
+    define('FRAMADATE_DB_PORT', getenv('FRAMADATE_DB_PORT') ? getenv('FRAMADATE_DB_PORT') : '');
+    define('FRAMADATE_DB_USER', getenv('FRAMADATE_DB_USER') ? getenv('FRAMADATE_DB_USER') : '');
+    define('FRAMADATE_DB_PASSWORD', getenv('FRAMADATE_DB_PASSWORD') ? getenv('FRAMADATE_DB_PASSWORD') : '');
 }
 define('CONF_FILENAME', ROOT_DIR . $path);
 
diff --git a/bin/doctrine b/bin/doctrine
index 5bcd655011aff50c07498c0c33a7813d410e0e4a..68e23ad52a4ac99426b8e79610078c45cfaa65f4 100755
--- a/bin/doctrine
+++ b/bin/doctrine
@@ -55,4 +55,5 @@ try {
     $cli->run($input, $output);
 } catch (\Exception $e) {
     $style->error($e->getMessage());
+    exit(1);
 }