Commit 94c3dc30 authored by Matthieu FAURE's avatar Matthieu FAURE
Browse files

Comptoir-srv v2.4.8

parents 5630c219 4e76a7ae
Pipeline #1565 failed with stage
in 9 minutes and 58 seconds
......@@ -27,18 +27,18 @@
*.pem eol=lf
# Denote all files that are truly binary and should not be modified.
*.png filter=lfs diff=lfs merge=lfs -text
*.png binary
*.jpg binary
*.gif filter=lfs diff=lfs merge=lfs -text
*.gif binary
*.ico binary
*.mo binary
*.pdf binary
*.phar binary
*.jpeg filter=lfs diff=lfs merge=lfs -text
*.svg filter=lfs diff=lfs merge=lfs -text
*.tar.gz filter=lfs diff=lfs merge=lfs -text
*.jpeg binary
*.svg binary
*.tar.gz binary
# font awesome
# Font awesome
*.ttf binary
*.eot binary
*.woff binary
......
# Backup files
*~
# Netbeans
nbproject/private/
# IntelliJ
*.iml
.idea/
# Docker tmp files
Docker/*tar.gz
# CakePHP
config/app.php
logs/
tmp/
vendor/
# CakePHP Uploaded files
# Comptoir: Uploaded files
webroot/img/files/
webroot/img/files-tmp/
webroot/files/
webroot/files-tmp/
# Comptoir: config files
config/Seeds/
/webroot/files/
/config/comptoir.php
config/comptoir.php
config/Migrations/20170421082041_RemoveWebSiteUrlFromSoftwares.php
src/Controller/Api/V1/Component/
# Vagrant
tests/Gitlab_runner_locally/Vagrant/.vagrant
tests/Gitlab_runner_locally/Vagrant/*.log
# E2E_testing
Docker/E2E-Testing-local/tests/
venv/
*geckodriver.log
*.pyc
image: docker:latest
stages:
- test
- deploy
# Select image from https://hub.docker.com/_/php/
image: php:7
# Select what we should cache
cache:
paths:
- vendor/
before_script:
# Install git, the php image doesn't have installed
- apt-get update -yqq
- apt-get install git libicu-dev zip unzip -yqq
# Install postgres driver
- apt-get install -y libpq-dev
- docker-php-ext-install pdo_pgsql
- docker-php-ext-install intl
# Install xdebug for code coverage
- pecl install xdebug
- docker-php-ext-enable xdebug
# Install composer
- curl -sS https://getcomposer.org/installer | php
# Install all project dependencies
- php composer.phar install
- cp config/comptoir.default.php config/comptoir.php
# When using "dind", it's wise to use the overlayfs driver for
# improved performance.
variables:
DOCKER_DRIVER: overlay
services:
- postgres:9.5
variables:
# Configure postgres service
POSTGRES_DB: test_myapp
POSTGRES_USER: my_app
POSTGRES_PASSWORD: secret
- docker:dind
before_script:
- apk add --update python py-pip python-dev bash
#- pip install --upgrade pip # TODO freeze a version of PIP
- pip install docker-compose
# We test PHP7 with PostgresSQL
test:
tags :
- docker
unit_tests:
stage: test
script:
- vendor/bin/phpunit --configuration phpunit.xml --coverage-text
#deploy_review:
# stage: deploy
# script:
# - docker-compose build --no-cache
- docker-compose -f ./Docker/compose-Comptoir-Dev.yml build
- docker-compose -f ./Docker/compose-Comptoir-Dev.yml up -d --remove-orphans
- docker exec docker_comptoir_dev_1 vendor/bin/phpunit --configuration phpunit.xml --coverage-text
- docker-compose -f ./Docker/compose-Comptoir-Dev.yml down
# Changelog
Tous les changements notables de ce projet sont documentés dans ce fichier.
Le format s'appuie sur [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
et le projet suit [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [2.4.8-rc.1] - 2018-08-07
### Added
* Nouveau système de gestion d'étiquettes (tags) pour les logiciels
### Changed
* Les prestataires sont maintenant séparés des utilisateurs et disposent d'une entrée propre dans la barre de navigation.
### Security
### Fixed
* Correction de bugs d'internationalisation (tout est censé être traduit de l'anglais vers le français)
## [2.4.7] - 2018-03-30
## [2.4.6] - 2018-03-02
## [2.4.5] - 2018-02-02
## [2.4.4] - 2018-01-05
## [2.4.3] - 2017-12-22
## [2.4.2] - 2017-11-24
## [2.4.1] - 2017-08-18
## [2.4.0] - 2017-08-04
## [2.3.2] - 2017-07-21
# Comptoir-du-libre with Docker
## Pre-requisites
1. [Install docker](https://docs.docker.com/engine/installation/linux/ubuntu/#install-using-the-repository)
2. Clone the [`Comptoir-srv` repository](https://gitlab.adullact.net/Comptoir/Comptoir-srv.git) in your project directory
## Usage
1. Get into the `Docker` directory of the project you just cloned
1. You can specify the branch you want to test, default develop ,by editing `my-branch` in the ./Docker/compose-Comptoir-Dev.yml
1. Run `docker-compose -f ./compose-Comptoir-Dev.yml build`
1. Run `docker-compose -f ./compose-Comptoir-Dev.yml up -d`
1. Check if `docker_postgres_comptoir` and `docker_comptoir` are running with `docker ps`
1. Now go to [http://localhost:8080](http://localhost:8080)
Enjoy ! :)
## Rebuild the image
When you have pushed code, you may want to see the result in a Docker environment. To do so, you first need to delete the existing containers and images, and then recreate them.
```
for i in docker_comptoir_dev_1 docker_postgres_comptoir_dev_1; do docker stop $i ; docker rm $i ; done
docker rmi docker_comptoir_dev:latest
```
## Coming soon
* ADD files like :
* Screenshots
* Avatar
* Logos
FROM codeception/codeception
RUN mkdir -p /home/comptoir/tests
COPY tests/ Project/tests/
FROM php:7.0-apache
ENV DEBIAN_FRONTEND noninteractive
ARG my_branch
####################################################
# Pre-requesites #
####################################################
RUN apt-get update -q \
&& apt-get install -qqy \
git-core \
curl \
python-dev \
python-pip \
python-dev \
libicu-dev \
libmcrypt-dev \
libpq-dev \
libxml2-dev \
&& apt-get clean \
&& curl --silent --show-error https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& docker-php-ext-install \
intl \
mcrypt \
pgsql \
xml \
zip \
&& a2enmod rewrite
####################################################
# Comptoir specifics #
####################################################
COPY php.ini /usr/local/etc/php/
RUN useradd -d /home/comptoir/ -m -s /bin/bash comptoir
USER comptoir
RUN git clone https://gitlab.adullact.net/Comptoir/Comptoir-srv.git /home/comptoir/Comptoir-srv/
WORKDIR /home/comptoir/Comptoir-srv/
RUN git checkout $my_branch
####################################################
# Composer and Comptoir installation #
####################################################
# --ignore-platform-reqs is required because:
# "The composer image does not contain the extension. Your application image does.
# Composer is not running inside your application image though, it is running inside its own image."
# Source https://github.com/RobLoach/docker-composer/issues/104#issuecomment-251073334
RUN composer install --no-dev --ignore-platform-reqs \
# ---------
# Copy the app.php file
# Inject some non random salt for this example
# Make sessionhandler based on env file
&& cp config/app.default.php config/app.php \
&& sed -i -e "s/__SALT__/somerandomsalt/" config/app.php \
&& sed -i -e "s/'php',/env('SESSION_DEFAULTS', 'php'),/" config/app.php \
&& cp config/comptoir.default.php config/comptoir.php \
&& tar zxvf tests/TestFiles/FunctionalsTests/files.tar.gz -C webroot/img/
USER root
RUN usermod -aG comptoir root \
&& usermod -aG comptoir www-data \
&& chgrp -R comptoir logs tmp webroot \
&& chmod -R g+rw logs tmp webroot \
&& chmod g+s tmp/cache/persistent/
####################################################
# Apache: adjust conf and run #
####################################################
ENV APACHE_DOCUMENT_ROOT /home/comptoir/Comptoir-srv/webroot
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf \
&& sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
EXPOSE 80
CMD ["apache2-foreground"]
# Docker Image Comptoir on Debian 9 Stretch
As of 2018-04-07 this image build but the app is not working. File `logs/error.log` tells:
```
2018-04-07 13:26:02 Warning: Warning (2): Invalid argument supplied for foreach() in [/home/comptoir/Comptoir-srv/src/Template/Element/Pages/footer.ctp, line 36]
Request URL: /
Client IP: 172.20.0.1
Trace:
Cake\Error\BaseErrorHandler::handleError() - CORE/src/Error/BaseErrorHandler.php, line 146
include - APP/Template/Element/Pages/footer.ctp, line 36
Cake\View\View::_evaluate() - CORE/src/View/View.php, line 1014
Cake\View\View::_render() - CORE/src/View/View.php, line 973
Cake\View\View::_renderElement() - CORE/src/View/View.php, line 1363
Cake\View\View::element() - CORE/src/View/View.php, line 501
include - APP/Template/Layout/base.ctp, line 22
Cake\View\View::_evaluate() - CORE/src/View/View.php, line 1014
Cake\View\View::_render() - CORE/src/View/View.php, line 973
Cake\View\View::renderLayout() - CORE/src/View/View.php, line 644
Cake\View\View::render() - CORE/src/View/View.php, line 602
App\View\AppView::render() - APP/View/AppView.php, line 49
Cake\Controller\Controller::render() - CORE/src/Controller/Controller.php, line 617
Cake\Error\ExceptionRenderer::_outputMessage() - CORE/src/Error/ExceptionRenderer.php, line 319
Cake\Error\ExceptionRenderer::render() - CORE/src/Error/ExceptionRenderer.php, line 194
Cake\Error\ErrorHandler::_displayException() - CORE/src/Error/ErrorHandler.php, line 144
Cake\Error\BaseErrorHandler::handleException() - CORE/src/Error/BaseErrorHandler.php, line 180
Cake\Error\BaseErrorHandler::wrapAndHandleException() - CORE/src/Error/BaseErrorHandler.php, line 164
[main] - [internal], line ??
2018-04-07 13:26:02 Error: [Cake\Database\Exception\MissingExtensionException] Database driver Cake\Database\Driver\Postgres cannot be used due to a missing PHP extension or unmet dependency
Request URL: /
Client IP: 172.20.0.1
Stack Trace:
#0 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Database/Connection.php(108): Cake\Database\Connection->driver(Object(Cake\Database\Driver\Postgres), Array)
#1 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Datasource/ConnectionRegistry.php(89): Cake\Database\Connection->__construct(Array)
#2 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Core/ObjectRegistry.php(93): Cake\Datasource\ConnectionRegistry->_create('Cake\\Database\\C...', 'default', Array)
#3 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Datasource/ConnectionManager.php(205): Cake\Core\ObjectRegistry->load('Cake\\Database\\C...', Array)
#4 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/ORM/Locator/TableLocator.php(175): Cake\Datasource\ConnectionManager::get('default')
#5 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/ORM/TableRegistry.php(110): Cake\ORM\Locator\TableLocator->get('Pages', Array)
#6 /home/comptoir/Comptoir-srv/src/Controller/Component/ValidationRulesComponent.php(28): Cake\ORM\TableRegistry::get('Pages')
#7 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Controller/Component.php(129): App\Controller\Component\ValidationRulesComponent->initialize(Array)
#8 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Controller/ComponentRegistry.php(118): Cake\Controller\Component->__construct(Object(Cake\Controller\ComponentRegistry), Array)
#9 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Core/ObjectRegistry.php(93): Cake\Controller\ComponentRegistry->_create('App\\Controller\\...', 'ValidationRules', Array)
#10 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Controller/Controller.php(322): Cake\Core\ObjectRegistry->load('ValidationRules', Array)
#11 /home/comptoir/Comptoir-srv/src/Controller/AppController.php(91): Cake\Controller\Controller->loadComponent('ValidationRules')
#12 /home/comptoir/Comptoir-srv/src/Controller/Api/V1/PagesController.php(40): App\Controller\AppController->initialize()
#13 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Controller/Controller.php(262): App\Controller\Api\V1\PagesController->initialize()
#14 [internal function]: Cake\Controller\Controller->__construct(Object(Cake\Network\Request), Object(Cake\Network\Response), 'Pages')
#15 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Http/ControllerFactory.php(79): ReflectionClass->newInstance(Object(Cake\Network\Request), Object(Cake\Network\Response), 'Pages')
#16 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Routing/Filter/ControllerFactoryFilter.php(63): Cake\Http\ControllerFactory->create(Object(Cake\Network\Request), Object(Cake\Network\Response))
#17 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Routing/Filter/ControllerFactoryFilter.php(49): Cake\Routing\Filter\ControllerFactoryFilter->_getController(Object(Cake\Network\Request), Object(Cake\Network\Response))
#18 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Routing/DispatcherFilter.php(144): Cake\Routing\Filter\ControllerFactoryFilter->beforeDispatch(Object(Cake\Event\Event))
#19 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Event/EventManager.php(426): Cake\Routing\DispatcherFilter->handle(Object(Cake\Event\Event), Object(Cake\Network\Request), Object(Cake\Network\Response))
#20 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Event/EventManager.php(391): Cake\Event\EventManager->_callListener(Array, Object(Cake\Event\Event))
#21 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Event/EventDispatcherTrait.php(78): Cake\Event\EventManager->dispatch(Object(Cake\Event\Event))
#22 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Http/ActionDispatcher.php(80): Cake\Http\ActionDispatcher->dispatchEvent('Dispatcher.befo...', Array)
#23 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Routing/Dispatcher.php(60): Cake\Http\ActionDispatcher->dispatch(Object(Cake\Network\Request), Object(Cake\Network\Response))
#24 /home/comptoir/Comptoir-srv/webroot/index.php(36): Cake\Routing\Dispatcher->dispatch(Object(Cake\Network\Request), Object(Cake\Network\Response))
#25 {main}
```
date.timezone = "Europe/Paris"
upload_max_filesize = 2M
FROM php:7.2-apache
ENV DEBIAN_FRONTEND noninteractive
ARG my_branch
####################################################
# Pre-requesites #
####################################################
RUN apt-get update -q \
&& apt-get install -qqy \
git-core \
curl \
python-dev \
python-pip \
python-dev \
libicu-dev \
libpq-dev \
libxml2-dev \
zlib1g-dev \
&& apt-get clean \
&& curl --silent --show-error https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN docker-php-ext-install -j$(nproc) intl
RUN docker-php-ext-install -j$(nproc) pgsql
RUN docker-php-ext-install -j$(nproc) zip
RUN apt-get install -qqy libmcrypt-dev
RUN pecl install mcrypt-1.0.1
COPY php.ini /usr/local/etc/php/
RUN docker-php-ext-enable \
mcrypt
RUN a2enmod rewrite
####################################################
# Comptoir specifics #
####################################################
RUN useradd -d /home/comptoir/ -m -s /bin/bash comptoir
USER comptoir
RUN git clone https://gitlab.adullact.net/Comptoir/Comptoir-srv.git /home/comptoir/Comptoir-srv/
WORKDIR /home/comptoir/Comptoir-srv/
RUN git checkout $my_branch
####################################################
# Composer and Comptoir installation #
####################################################
# --ignore-platform-reqs is required because:
# "The composer image does not contain the extension. Your application image does.
# Composer is not running inside your application image though, it is running inside its own image."
# Source https://github.com/RobLoach/docker-composer/issues/104#issuecomment-251073334
RUN composer install --no-dev --ignore-platform-reqs \
# ---------
# Copy the app.php file
# Inject some non random salt for this example
# Make sessionhandler based on env file
&& cp config/app.default.php config/app.php \
&& sed -i -e "s/__SALT__/somerandomsalt/" config/app.php \
&& sed -i -e "s/'php',/env('SESSION_DEFAULTS', 'php'),/" config/app.php \
&& cp config/comptoir.default.php config/comptoir.php \
&& tar zxvf tests/TestFiles/FunctionalsTests/files.tar.gz -C webroot/img/
USER root
RUN usermod -aG comptoir root \
&& usermod -aG comptoir www-data \
&& chgrp -R comptoir logs tmp webroot \
&& chmod -R g+rw logs tmp webroot \
&& chmod g+s tmp/cache/persistent/
####################################################
# Apache: adjust conf and run #
####################################################
ENV APACHE_DOCUMENT_ROOT /home/comptoir/Comptoir-srv/webroot
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf \
&& sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
EXPOSE 80
CMD ["apache2-foreground"]
# Docker Image Comptoir on Debian 9 Stretch
As of 2018-04-07 this image build but the app is not working. File `logs/error.log` tells:
```
2018-04-07 13:26:02 Warning: Warning (2): Invalid argument supplied for foreach() in [/home/comptoir/Comptoir-srv/src/Template/Element/Pages/footer.ctp, line 36]
Request URL: /
Client IP: 172.20.0.1
Trace:
Cake\Error\BaseErrorHandler::handleError() - CORE/src/Error/BaseErrorHandler.php, line 146
include - APP/Template/Element/Pages/footer.ctp, line 36
Cake\View\View::_evaluate() - CORE/src/View/View.php, line 1014
Cake\View\View::_render() - CORE/src/View/View.php, line 973
Cake\View\View::_renderElement() - CORE/src/View/View.php, line 1363
Cake\View\View::element() - CORE/src/View/View.php, line 501
include - APP/Template/Layout/base.ctp, line 22
Cake\View\View::_evaluate() - CORE/src/View/View.php, line 1014
Cake\View\View::_render() - CORE/src/View/View.php, line 973
Cake\View\View::renderLayout() - CORE/src/View/View.php, line 644
Cake\View\View::render() - CORE/src/View/View.php, line 602
App\View\AppView::render() - APP/View/AppView.php, line 49
Cake\Controller\Controller::render() - CORE/src/Controller/Controller.php, line 617
Cake\Error\ExceptionRenderer::_outputMessage() - CORE/src/Error/ExceptionRenderer.php, line 319
Cake\Error\ExceptionRenderer::render() - CORE/src/Error/ExceptionRenderer.php, line 194
Cake\Error\ErrorHandler::_displayException() - CORE/src/Error/ErrorHandler.php, line 144
Cake\Error\BaseErrorHandler::handleException() - CORE/src/Error/BaseErrorHandler.php, line 180
Cake\Error\BaseErrorHandler::wrapAndHandleException() - CORE/src/Error/BaseErrorHandler.php, line 164
[main] - [internal], line ??
2018-04-07 13:26:02 Error: [Cake\Database\Exception\MissingExtensionException] Database driver Cake\Database\Driver\Postgres cannot be used due to a missing PHP extension or unmet dependency
Request URL: /
Client IP: 172.20.0.1
Stack Trace:
#0 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Database/Connection.php(108): Cake\Database\Connection->driver(Object(Cake\Database\Driver\Postgres), Array)
#1 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Datasource/ConnectionRegistry.php(89): Cake\Database\Connection->__construct(Array)
#2 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Core/ObjectRegistry.php(93): Cake\Datasource\ConnectionRegistry->_create('Cake\\Database\\C...', 'default', Array)
#3 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Datasource/ConnectionManager.php(205): Cake\Core\ObjectRegistry->load('Cake\\Database\\C...', Array)
#4 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/ORM/Locator/TableLocator.php(175): Cake\Datasource\ConnectionManager::get('default')
#5 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/ORM/TableRegistry.php(110): Cake\ORM\Locator\TableLocator->get('Pages', Array)
#6 /home/comptoir/Comptoir-srv/src/Controller/Component/ValidationRulesComponent.php(28): Cake\ORM\TableRegistry::get('Pages')
#7 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Controller/Component.php(129): App\Controller\Component\ValidationRulesComponent->initialize(Array)
#8 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Controller/ComponentRegistry.php(118): Cake\Controller\Component->__construct(Object(Cake\Controller\ComponentRegistry), Array)
#9 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Core/ObjectRegistry.php(93): Cake\Controller\ComponentRegistry->_create('App\\Controller\\...', 'ValidationRules', Array)
#10 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Controller/Controller.php(322): Cake\Core\ObjectRegistry->load('ValidationRules', Array)
#11 /home/comptoir/Comptoir-srv/src/Controller/AppController.php(91): Cake\Controller\Controller->loadComponent('ValidationRules')
#12 /home/comptoir/Comptoir-srv/src/Controller/Api/V1/PagesController.php(40): App\Controller\AppController->initialize()
#13 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Controller/Controller.php(262): App\Controller\Api\V1\PagesController->initialize()
#14 [internal function]: Cake\Controller\Controller->__construct(Object(Cake\Network\Request), Object(Cake\Network\Response), 'Pages')
#15 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Http/ControllerFactory.php(79): ReflectionClass->newInstance(Object(Cake\Network\Request), Object(Cake\Network\Response), 'Pages')
#16 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Routing/Filter/ControllerFactoryFilter.php(63): Cake\Http\ControllerFactory->create(Object(Cake\Network\Request), Object(Cake\Network\Response))
#17 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Routing/Filter/ControllerFactoryFilter.php(49): Cake\Routing\Filter\ControllerFactoryFilter->_getController(Object(Cake\Network\Request), Object(Cake\Network\Response))
#18 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Routing/DispatcherFilter.php(144): Cake\Routing\Filter\ControllerFactoryFilter->beforeDispatch(Object(Cake\Event\Event))
#19 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Event/EventManager.php(426): Cake\Routing\DispatcherFilter->handle(Object(Cake\Event\Event), Object(Cake\Network\Request), Object(Cake\Network\Response))
#20 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Event/EventManager.php(391): Cake\Event\EventManager->_callListener(Array, Object(Cake\Event\Event))
#21 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Event/EventDispatcherTrait.php(78): Cake\Event\EventManager->dispatch(Object(Cake\Event\Event))
#22 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Http/ActionDispatcher.php(80): Cake\Http\ActionDispatcher->dispatchEvent('Dispatcher.befo...', Array)
#23 /home/comptoir/Comptoir-srv/vendor/cakephp/cakephp/src/Routing/Dispatcher.php(60): Cake\Http\ActionDispatcher->dispatch(Object(Cake\Network\Request), Object(Cake\Network\Response))
#24 /home/comptoir/Comptoir-srv/webroot/index.php(36): Cake\Routing\Dispatcher->dispatch(Object(Cake\Network\Request), Object(Cake\Network\Response))
#25 {main}
```
date.timezone = "Europe/Paris"
upload_max_filesize = 2M
extension = mcrypt.so
FROM ubuntu:16.04
ENV DEBIAN_FRONTEND noninteractive
####################################################
# Pre-requesites #
####################################################
RUN apt-get update -q \
&& apt-get install -qqy \
git-core \
composer \
libapache2-mod-php \
php-mcrypt \
php-intl \
php-mbstring \
php-zip \
php-xml \
php-pgsql \
php-curl \
&& apt-get clean \
# Enable mod rewrite and listen to localhost
&& a2enmod rewrite \
&& echo "ServerName localhost" >> /etc/apache2/apache2.conf
COPY apache_default /etc/apache2/sites-available/000-default.conf
# Docker image: Comptoir-Ubuntu-base
This image is used to save time when building the actual image for Comptoir app.
## How to upload image to Gitlab Docker Registry
```
docker login gitlab.adullact.net:4567
docker build -t gitlab.adullact.net:4567/comptoir/comptoir-srv/comptoir-ubuntu-base:v1.0.0-rc.1 .
docker images
```
check that the image has been built.
```
docker push gitlab.adullact.net:4567/comptoir/comptoir-srv/comptoir-ubuntu-base:v1.0.0-rc.1
```
Be careful to the tag of the version. Set up the right version you want to.
If no tag specified, by default it will be tag `latest`.
In time the build of the image will be done directly on the gitlab.
FROM gitlab.adullact.net:4567/comptoir/comptoir-srv/comptoir-ubuntu-base:v1.0.0-rc.1
ENV DEBIAN_FRONTEND noninteractive
ARG my_branch
####################################################
# Comptoir specifics #
####################################################
WORKDIR /var/www/html
RUN rm -rf /var/www/html/* \
&& git clone https://gitlab.adullact.net/Comptoir/Comptoir-srv.git /var/www/html \
&& git checkout $my_branch \
&& composer install --no-progress \
&& cp config/app.default.php config/app.php \
&& sed -i -e "s/\/\/COMPTOIR-DEBUG//" config/app.php \
# Inject some non random salt for this example
&& sed -i -e "s/__SALT__/somerandomsalt/" config/app.php \
# Make sessionhandler based on env file
&& sed -i -e "s/'php',/env('SESSION_DEFAULTS', 'php'),/" config/app.php \
&& cp config/comptoir.default.php config/comptoir.php \
&& tar zxvf tests/TestFiles/FunctionalsTests/files.tar.gz -C webroot/img/ \
&& groupadd comptoir \
&& usermod -aG comptoir root \
&& usermod -aG comptoir www-data \
&& chgrp -R comptoir logs tmp webroot \
&& chmod -R g+rw logs tmp webroot \
&& chmod g+s tmp/cache/persistent/
####################################################
# Apache: adjust conf and run #
####################################################
EXPOSE 80
CMD ["/usr/sbin/apache2ctl", "-DFOREGROUND"]
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
# To make .htaccess work
AllowOverride FileInfo
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>