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

Docker: corrections pour faire pareil que pour le projet sygal

parent 3db208b1
###########################################################################################
#
# Image pour le dev.
#
# Montage des sources attendu dans le volume "/webapp" du container.
#
###########################################################################################
FROM php:7-apache FROM unicaen-dev-php7.0-apache
LABEL maintainer="Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>" LABEL maintainer="Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>"
# Mise à niveau de la distrib et installation des packages requis. # Symlink apache access and error logs to stdout/stderr so Docker logs shows them
RUN apt-get update && apt-get install -y \ RUN ln -sf /dev/stdout /var/log/apache2/access.log
ghostscript \ RUN ln -sf /dev/stdout /var/log/apache2/other_vhosts_access.log
git \ RUN ln -sf /dev/stderr /var/log/apache2/error.log
libaio1 \
libcurl4-openssl-dev \
libfreetype6-dev \
libicu-dev \
libjpeg62-turbo-dev \
libldap2-dev \
libmcrypt-dev \
libmemcached-dev \
libssl-dev \
libxml2-dev \
make \
netcat-openbsd \
ssl-cert \
subversion \
unzip \
vim \
wget \
zlib1g-dev
RUN docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu && \
docker-php-ext-configure opcache --enable-opcache && \
docker-php-ext-install -j$(nproc) \
curl \
gd \
gettext \
iconv \
intl \
ldap \
mbstring \
opcache \
soap \
zip
RUN 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 memcached && docker-php-ext-enable memcached
# Package PHP Oracle OCI8
ADD docker/instantclient-basiclite-linux.x64-12.2.0.1.0.zip /tmp/
ADD docker/instantclient-sdk-linux.x64-12.2.0.1.0.zip /tmp/
ADD docker/instantclient-sqlplus-linux.x64-12.2.0.1.0.zip /tmp/
RUN unzip /tmp/instantclient-basiclite-linux.x64-12.2.0.1.0.zip -d /usr/local/ && \
unzip /tmp/instantclient-sdk-linux.x64-12.2.0.1.0.zip -d /usr/local/ && \
unzip /tmp/instantclient-sqlplus-linux.x64-12.2.0.1.0.zip -d /usr/local/ && \
ln -s /usr/local/instantclient_12_2 /usr/local/instantclient && \
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 '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. # Config PHP.
ADD docker/php.conf /usr/local/etc/php/conf.d/webapp.ini ADD docker/php.conf ${PHP_CONF_DIR}/fpm/conf.d/sygal-import-ws.ini
#ADD docker/php-opcache.ini /usr/local/etc/php/conf.d/01-opcache.ini
# Configuration et activation des sites Apache # Configuration Apache et FPM
ADD docker/apache-ports.conf /etc/apache2/ports.conf ADD docker/apache-ports.conf ${APACHE_CONF_DIR}/ports.conf
ADD docker/apache-site.conf /etc/apache2/sites-available/webapp.conf ADD docker/apache-site.conf ${APACHE_CONF_DIR}/sites-available/sygal-import-ws.conf
ADD docker/apache-site-ssl.conf /etc/apache2/sites-available/webapp-ssl.conf ADD docker/apache-site-ssl.conf ${APACHE_CONF_DIR}/sites-available/sygal-import-ws-ssl.conf
RUN a2enmod headers alias rewrite ssl && \ ADD docker/fpm/pool.d/app.conf ${PHP_CONF_DIR}/fpm/pool.d/sygal-import-ws.conf
a2ensite webapp && \
a2ensite webapp-ssl
# Install Composer. RUN a2ensite sygal-import-ws sygal-import-ws-ssl && \
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer service php7.0-fpm reload
...@@ -6,9 +6,9 @@ services: ...@@ -6,9 +6,9 @@ services:
build: build:
context: . context: .
ports: ports:
- "8080:8080" - "8080:80"
- "8443:8443" - "8443:443"
volumes: volumes:
- .:/var/www/html/sygal-import-ws - .:/var/www/sygal-import-ws
working_dir: /var/www/html/sygal-import-ws working_dir: /var/www/sygal-import-ws
network_mode: bridge network_mode: bridge
Listen 8080 Listen 80
Listen 8443 Listen 443
<VirtualHost *:8443> <VirtualHost *:443>
ServerName localhost ServerName localhost
DocumentRoot /var/www/html/sygal-import-ws/public DocumentRoot /var/www/sygal-import-ws/public
RewriteEngine On RewriteEngine On
<Directory /var/www/html/sygal-import-ws/public> <Directory /var/www/sygal-import-ws/public>
DirectoryIndex index.php DirectoryIndex index.php
AllowOverride All AllowOverride All
Require all granted Require all granted
</Directory> </Directory>
<IfModule proxy_fcgi_module>
<FilesMatch ".+\.ph(ar|p|tml)$">
SetHandler "proxy:unix:/var/run/php7.0-fpm-sygal-import-ws.sock|fcgi://localhost/"
</FilesMatch>
</IfModule>
SSLEngine on SSLEngine on
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
Header always set Strict-Transport-Security "max-age=15768000; includeSubdomains;"
ErrorLog ${APACHE_LOG_DIR}/error.log ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined CustomLog ${APACHE_LOG_DIR}/access.log combined
#LogLevel debug #LogLevel debug
......
<VirtualHost *:8080> <VirtualHost *:80>
ServerName localhost ServerName localhost
DocumentRoot /var/www/html/sygal-import-ws/public DocumentRoot /var/www/sygal-import-ws/public
RewriteEngine On RewriteEngine On
### Redirection en HTTPS Header always set Strict-Transport-Security "max-age=15768000; includeSubdomains;"
RewriteCond %{SERVER_PORT} !^8443$
RewriteRule ^/(.*) https://%{SERVER_NAME}:8443/$1 [L,R]
<Directory /var/www/html/sygal-import-ws/public> ### Redirection en HTTPS
DirectoryIndex index.php RewriteCond %{SERVER_PORT} !^443$
AllowOverride All RewriteRule ^/(.*) https://%{SERVER_NAME}:443/$1 [L,R]
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
#LogLevel debug
</VirtualHost> </VirtualHost>
\ No newline at end of file
[sygal-import-ws]
user = www-data
group = www-data
listen = /var/run/php7.0-fpm-sygal-import-ws.sock
listen.owner = www-data
listen.group = www-data
; mandatory values
; Soit:
; pm = dynamic
; pm.max_children = 5
; pm.start_servers = 2
; pm.min_spare_servers = 1
; pm.max_spare_servers = 3
; Soit:
pm = ondemand
pm.max_children = 35
pm.process_idle_timeout = 10s
pm.max_requests = 500
request_slowlog_timeout = 30
slowlog = /var/log/php5-fpm.slow.log
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
date.timezone = Europe/Paris date.timezone = Europe/Paris
short_open_tag = Off
expose_php = Off
#display_startup_errors = On
#error_reporting = E_ALL & ~E_DEPRECATED & ~E_NOTICE #error_reporting = E_ALL & ~E_DEPRECATED & ~E_NOTICE
#display_startup_errors = 1 display_errors = Off
display_errors = 0
# opcache.enable = 0
#upload_max_filesize = 51M #upload_max_filesize = 51M
#post_max_size = 60M #post_max_size = 60M
#
#xdebug.remote_enable = 1
#xdebug.remote_connect_back = 1
#xdebug.profiler_enable_trigger = 1
#xdebug.max_nesting_level = 250
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