Commit 6d171b78 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Docker: Renommage de fichiers de config apache, ajout config HTTPS.

parent 6b76796c
......@@ -12,6 +12,7 @@ LABEL maintainer="Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>"
# Mise à niveau de la distrib.
RUN apt-get update && apt-get install -y \
ghostscript \
git \
libaio1 \
libcurl4-openssl-dev \
......@@ -20,10 +21,12 @@ RUN apt-get update && apt-get install -y \
libjpeg62-turbo-dev \
libldap2-dev \
libmcrypt-dev \
libmemcached-dev \
libssl-dev \
libxml2-dev \
make \
netcat-openbsd \
ssl-cert \
subversion \
unzip \
vim \
......@@ -31,11 +34,13 @@ RUN apt-get update && apt-get install -y \
zlib1g-dev \
&& docker-php-ext-install -j$(nproc) iconv gettext gd soap curl intl zip \
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu && docker-php-ext-install ldap \
&& docker-php-ext-configure opcache --enable-opcache && docker-php-ext-install opcache \
&& rm -rf /var/lib/apt/lists/*
# Installation d'extensions PECL
RUN pear config-set http_proxy "$HTTP_PROXY" && \
pecl install xdebug && docker-php-ext-enable xdebug
pecl install xdebug && docker-php-ext-enable xdebug && \
pecl install memcached && docker-php-ext-enable memcached
# Package PHP Oracle OCI8
ADD docker/instantclient-basiclite-linux.x64-12.2.0.1.0.zip /tmp/
......@@ -48,18 +53,24 @@ RUN unzip /tmp/instantclient-basiclite-linux.x64-12.2.0.1.0.zip -d /usr/local/ &
ln -s /usr/local/instantclient/libclntsh.so.12.1 /usr/local/instantclient/libclntsh.so && \
ln -s /usr/local/instantclient/sqlplus /usr/bin/sqlplus && \
echo 'export LD_LIBRARY_PATH="/usr/local/instantclient"' >> /etc/apache2/envvars && \
echo 'export LD_LIBRARY_PATH="/usr/local/instantclient"' >> /root/.bashrc && \
echo 'umask 002' >> /root/.bashrc && \
# echo 'export LD_LIBRARY_PATH="/usr/local/instantclient"' >> /root/.bashrc && \
# echo 'umask 002' >> /root/.bashrc && \
echo 'instantclient,/usr/local/instantclient' | pecl install oci8 && \
echo "extension=oci8.so" > /usr/local/etc/php/conf.d/php-oci8.ini
ENV LD_LIBRARY_PATH /usr/local/instantclient
# Config PHP.
ADD docker/php.conf /usr/local/etc/php/conf.d/webapp.ini
#ADD docker/php-opcache.ini /usr/local/etc/php/conf.d/01-opcache.ini
# Configuration et activation du site Apache
ADD docker/apache.conf /etc/apache2/sites-available/webapp.conf
ADD docker/ports.conf /etc/apache2/ports.conf
RUN a2enmod rewrite && a2ensite webapp
# Configuration et activation des sites Apache
ADD docker/apache-ports.conf /etc/apache2/ports.conf
ADD docker/apache-site.conf /etc/apache2/sites-available/webapp.conf
ADD docker/apache-site-ssl.conf /etc/apache2/sites-available/webapp-ssl.conf
RUN a2enmod rewrite ssl && \
a2ensite webapp && \
a2ensite webapp-ssl
# Install Composer.
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
......@@ -63,9 +63,9 @@ $ composer development-disable
```
## Lancement du web service
## Lancement du web service *pour le dévelopement*
### Soit avec le built-in serveur PHP
### Solution 1 : le serveur interne PHP
En phase de développement, la façon la plus simple consiste en l'utilisation
du serveur interne de php :
......@@ -74,7 +74,7 @@ du serveur interne de php :
$ php -S 0.0.0.0:8080 -ddisplay_errors=0 -t public public/index.php
```
### Soit avec Docker
### Solution 2 : Docker
Se placer à la racine des sources du ws pour lancer la commande suivante :
......
This diff is collapsed.
11d10
< 'apogee' as code,
22,23d20
< 'apogee' as source_id, -- Id de la source
< cod_vap as id,
26,28c23
< par_vap,
< to_date('2017-01-01', 'YYYY-MM-DD') as DATE_DEB_VALIDITE,
< to_date('9999-12-31', 'YYYY-MM-DD') as DATE_FIN_VALIDITE
---
> par_vap
35,65c30
< )
< union all
< select
< 'apogee' as source_id,
< 'EMAIL_ASSISTANCE' as id,
< 'EMAIL_ASSISTANCE' as cod_vap,
< 'Adresse mail de l''assistance utilisateur' as lib_vap,
< 'assistance-sygal@unicaen.fr' as par_vap,
< to_date('2017-01-01', 'YYYY-MM-DD') as DATE_DEB_VALIDITE,
< to_date('9999-12-31', 'YYYY-MM-DD') as DATE_FIN_VALIDITE
< from dual
< union all
< select
< 'apogee' as source_id,
< 'EMAIL_BU' as id,
< 'EMAIL_BU' as cod_vap,
< 'Adresse mail de contact de la BU' as lib_vap,
< 'scd.theses@unicaen.fr' as par_vap,
< to_date('2017-01-01', 'YYYY-MM-DD') as DATE_DEB_VALIDITE,
< to_date('9999-12-31', 'YYYY-MM-DD') as DATE_FIN_VALIDITE
< from dual
< union all
< select
< 'apogee' as source_id,
< 'EMAIL_BDD' as id,
< 'EMAIL_BDD' as cod_vap,
< 'Adresse mail de contact du bureau des doctorats' as lib_vap,
< 'recherche.doctorat@unicaen.fr' as par_vap,
< to_date('2017-01-01', 'YYYY-MM-DD') as DATE_DEB_VALIDITE,
< to_date('9999-12-31', 'YYYY-MM-DD') as DATE_FIN_VALIDITE
< from dual;
---
> );
75c40
< to_char(ind.cod_etu) as id, -- Numero etudiant
---
> ind.cod_etu as id, -- Numero etudiant
79c44
< initcap(coalesce(ind.lib_pr1_ind,'Aucun')) as lib_pr1_ind, -- Prenom 1 etudiant
---
> initcap(ind.lib_pr1_ind) as lib_pr1_ind, -- Prenom 1 etudiant
82c47
< null as email,--ucbn_ldap.etu2mail ( ind.cod_etu ) as email, -- Mail etudiant
---
> ucbn_ldap.etu2mail ( ind.cod_etu ) as email, -- Mail etudiant
96d60
< and ind.cod_etu is not null -- oui, oui, ça arrive
99c63
< select "SOURCE_ID","TYPE","ID","CIV","LIB_NOM_USU_IND","LIB_NOM_PAT_IND","LIB_PR1_IND","LIB_PR2_IND","LIB_PR3_IND","EMAIL","DATE_NAI_IND","COD_PAY_NAT","LIB_NAT" from (
---
> select * from (
157,158c121,122
< coalesce(regexp_replace(per.num_dos_har_per,'[^0-9]',''), 'COD_PER_'||act.cod_per) as id, -- Code Harpege ou Apogee de l acteur
< --act.cod_per as id, -- Code Apogee de l acteur
---
> --coalesce(regexp_replace(per.num_dos_har_per,'[^0-9]',''), 'COD_PER_'||act.cod_per) as id, -- Code Harpege ou Apogee de l acteur
> act.cod_per as id, -- Code Apogee de l acteur
166c130
< null as email,--case when per.num_dos_har_per is null then null else ucbn_ldap.uid2mail ('p'||per.num_dos_har_per) end as email, -- Mail acteur
---
> case when per.num_dos_har_per is null then null else ucbn_ldap.uid2mail ('p'||per.num_dos_har_per) end as email, -- Mail acteur
197,198c161
< ind.cod_etu as id, -- Identifiant du doctorant
< ind.cod_etu as individu_id -- Identifiant de l'individu
---
> ind.cod_etu as id -- Numero etudiant
218d180
< and cod_etu is not null -- oui, oui, ça arrive
262c224
< ind.cod_etu doctorant_id, -- Identifiant du doctorant
---
> ind.cod_etu as individu_id, -- Numero etudiant
435d396
< rownum as id,
438c399
< roj.cod_roj as role_id, -- Identifiant du rôle
---
> roj.cod_roj as role_id, -- Code du role de l acteur
441c402,403
< coalesce(regexp_replace(per.num_dos_har_per,'[^0-9]',''), 'COD_PER_'||act.cod_per) as individu_id, -- Code Harpege ou Apogee de l acteur
---
> act.cod_per as individu_id, -- Code Apogee de l acteur
> --regexp_replace ( per.num_dos_har_per, '[^0-9]', '' ) as uid_per, -- uid de l acteur
This diff is collapsed.
......@@ -8,7 +8,8 @@ services:
dockerfile: Dockerfile.php7.dev
ports:
- "8080:8080"
- "8443:8443"
volumes:
- .:/sygal-import-ws
working_dir: /sygal-import-ws
- .:/var/www/html/sygal-import-ws
working_dir: /var/www/html/sygal-import-ws
network_mode: bridge
<VirtualHost *:8443>
ServerName sygal-pp.unicaen.fr
DocumentRoot /var/www/html/sygal-import-ws/public
RewriteEngine On
<Directory /var/www/html/sygal-import-ws/public>
DirectoryIndex index.php
AllowOverride All
Require all granted
</Directory>
SSLEngine on
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
#LogLevel debug
</VirtualHost>
<VirtualHost *:8080>
ServerName localhost
DocumentRoot /sygal-import-ws/public
ServerName sygal-pp.unicaen.fr
DocumentRoot /var/www/html/sygal-import-ws/public
RewriteEngine On
AllowEncodedSlashes On
<Directory /sygal-import-ws/public>
Options FollowSymLinks MultiViews
AllowOverride All
Require all granted
### Redirection en HTTPS
RewriteCond %{SERVER_PORT} !^8443$
RewriteRule ^/(.*) https://%{SERVER_NAME}:8443/$1 [L,R]
<Directory /var/www/html/sygal-import-ws/public>
DirectoryIndex index.php
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
#LogLevel debug
</VirtualHost>
\ No newline at end of file
</VirtualHost>
\ No newline at end of file
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
opcache.enable_cli=1
opcache.enable=1
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment