Commit 566d6417 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Docker: utilisation d'une variable PHP_VERSION ; plus de mention du nom de...

Docker: utilisation d'une variable PHP_VERSION ; plus de mention du nom de l'appli ou de la version de PHP dans les configs ; montage dans /app.
parent 49396dc4
Loading
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line

FROM unicaen-dev-php7.0-apache
ARG PHP_VERSION

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

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

@@ -10,10 +12,10 @@ 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/sygal-import-ws.conf
ADD docker/apache-site-ssl.conf ${APACHE_CONF_DIR}/sites-available/sygal-import-ws-ssl.conf
ADD docker/fpm/pool.d/app.conf  ${PHP_CONF_DIR}/fpm/pool.d/sygal-import-ws.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/

RUN a2ensite sygal-import-ws sygal-import-ws-ssl && \
    service php7.0-fpm reload
RUN a2ensite app app-ssl && \
    service php${PHP_VERSION}-fpm reload
+4 −2
Original line number Diff line number Diff line
@@ -5,10 +5,12 @@ services:
    container_name: sygal-import-ws-container
    build:
      context: .
      args:
        PHP_VERSION: 7.0
    ports:
     - "8080:80"
     - "8443:443"
    volumes:
     - .:/var/www/sygal-import-ws
    working_dir: /var/www/sygal-import-ws
     - .:/app
    working_dir: /app
    network_mode: bridge
+3 −3
Original line number Diff line number Diff line
<VirtualHost *:443>
     ServerName localhost
     DocumentRoot /var/www/sygal-import-ws/public
     DocumentRoot /app/public

     RewriteEngine On

     <Directory /var/www/sygal-import-ws/public>
     <Directory /app/public>
         DirectoryIndex index.php
         AllowOverride All
         Require all granted
@@ -12,7 +12,7 @@

    <IfModule proxy_fcgi_module>
        <FilesMatch ".+\.ph(ar|p|tml)$">
            SetHandler "proxy:unix:/var/run/php7.0-fpm-sygal-import-ws.sock|fcgi://localhost/"
            SetHandler "proxy:unix:/var/run/php-fpm.sock|fcgi://localhost/"
        </FilesMatch>
    </IfModule>

+1 −1
Original line number Diff line number Diff line
<VirtualHost *:80>
     ServerName localhost
     DocumentRoot /var/www/sygal-import-ws/public
     DocumentRoot /app/public

     RewriteEngine On

+5 −5
Original line number Diff line number Diff line
[sygal-import-ws]
[app]

user = www-data
group = www-data

listen = /var/run/php7.0-fpm-sygal-import-ws.sock
listen = /var/run/php-fpm.sock
listen.owner = www-data
listen.group = www-data

@@ -21,10 +21,10 @@ pm.process_idle_timeout = 10s
pm.max_requests = 500

request_slowlog_timeout = 30
slowlog = /var/log/php5-fpm.slow.log
slowlog = /var/log/php-fpm.slow.log

; Ensure worker stdout and stderr are sent to the main error log.
; catch_workers_output = yes

; error_log = /var/log/php5-fpm.error.log
; access.log = /var/log/php5-fpm.access.log
; error_log = /var/log/php-fpm.error.log
; access.log = /var/log/php-fpm.access.log