Commit cec2b6b3 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Merge branch 'zf-3.x' into develop

parents cfb09d21 b6566d91
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
vendor/
.idea
.DS_Store

.gitlab-ci.yml

0 → 100644
+22 −0
Original line number Diff line number Diff line
stages:
  - tests
  - publish

cache:
  key: ${CI_COMMIT_REF_SLUG}
  paths:
    - vendor/

#unit-tests:
#  stage: tests
#  script:
#    - composer install --no-interaction --no-suggest --no-progress
#    - php vendor/bin/phpunit --coverage-text=coverage.txt --colors=never
#  artifacts:
#    paths:
#      - coverage.txt

update-satis:
  stage: publish
  script:
    - update-satis

Dockerfile

0 → 100644
+43 −0
Original line number Diff line number Diff line
###########################################################################################
#
#                               Image pour le dev.
#
###########################################################################################

ARG PHP_VERSION

FROM unicaen-dev-php${PHP_VERSION}-apache

LABEL maintainer="Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>"

WORKDIR /app

ENV APACHE_CONF_DIR=/etc/apache2 \
    PHP_CONF_DIR=/etc/php/${PHP_VERSION}

## Installation de packages requis.
RUN apt-get update -qq && \
    apt-get install -y \
        sqlite3 \
        php${PHP_VERSION}-pdo-sqlite

RUN pecl install ast && \
    echo "extension=ast.so" > ${PHP_CONF_DIR}/cli/conf.d/ast.ini

# Nettoyage
RUN apt-get autoremove -y && apt-get clean && rm -rf /tmp/* /var/tmp/*

# Symlink apache access and error logs to stdout/stderr so Docker logs shows them
RUN ln -sf /dev/stdout /var/log/apache2/access.log
RUN ln -sf /dev/stdout /var/log/apache2/other_vhosts_access.log
RUN ln -sf /dev/stderr /var/log/apache2/error.log

# Configuration Apache et FPM
ADD docker/apache-ports.conf    ${APACHE_CONF_DIR}/ports.conf
ADD docker/apache-site.conf     ${APACHE_CONF_DIR}/sites-available/app.conf
ADD docker/apache-site-ssl.conf ${APACHE_CONF_DIR}/sites-available/app-ssl.conf
ADD docker/fpm/pool.d/app.conf  ${PHP_CONF_DIR}/fpm/pool.d/app.conf
ADD docker/fpm/conf.d/app.ini   ${PHP_CONF_DIR}/fpm/conf.d/app.ini

RUN a2ensite app app-ssl && \
    service php${PHP_VERSION}-fpm reload

README.md

0 → 100644
+47 −0
Original line number Diff line number Diff line
# Squelette d'application Unicaen


## Build et lancement du container Docker

    $ docker-compose up --build -d

## Installation des dépendances PHP :

    $ docker-compose run skeleton-application composer install

## Module Demo

Le module démo fournit une base de données de démonstration permettant d'avoir une authentification locale
qui fonctionne.

Jetez un oeil à la base de données de démo présente dans le module 'Demo' :
    
    $ docker-compose run skeleton-application sqlite3 module/Demo/data/db/demo.sqlite ".schema"

Interrogez la table `user` pour vérifier la présence de l'utilisateur local `demo`, exemple :
    
    $ docker-compose run skeleton-application sqlite3 module/Demo/data/db/demo.sqlite "select * from user;"

## Configuration du projet

- Renommez `config/autoload/local.php.dist` en `local.php`. 

- Copiez dans votre dossier `config/autoload` les fichiers de configuration locaux et globaux `.dist`
  des bibliothèques utilisées sans leur extension `.dist` :
```bash
cp vendor/unicaen/app/config/unicaen-app.global.php.dist   config/autoload/unicaen-app.global.php
cp vendor/unicaen/app/config/unicaen-app.local.php.dist    config/autoload/unicaen-app.local.php
cp vendor/unicaen/auth/config/unicaen-auth.global.php.dist config/autoload/unicaen-auth.global.php
cp vendor/unicaen/auth/config/unicaen-auth.local.php.dist  config/autoload/unicaen-auth.local.php
cp vendor/unicaen/code/config/unicaen-code.global.php.dist config/autoload/unicaen-code.global.php
```

- Le cas échéant, reportez-vous aux docs des modules concernés pour adapter ces fichiers de configuration à vos besoins :
  - [unicaen/app](https://git.unicaen.fr/lib/unicaen/app)
  - [unicaen/auth](https://git.unicaen.fr/lib/unicaen/auth)
  - [unicaen/code](https://git.unicaen.fr/lib/unicaen/code)

## Test de l'application 

Théoriquement, l'application devrait être accessible à l'adresse [https://localhost:8843](https://localhost:8843).
Le port utilisé dépend des redirections configurées dans le fichier [docker-compose.yml](docker-compose.yml).

bin/.gitignore

0 → 100644
+1 −0
Original line number Diff line number Diff line
reports/
Loading