Commit 3e49a646 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Améliorations concernant Docker.

parent 6726fc2a
......@@ -24,14 +24,12 @@ 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
# Config PHP.
ADD docker/php.conf ${PHP_CONF_DIR}/fpm/conf.d/webapp.ini
# Configuration Apache et FPM
ADD docker/apache-ports.conf ${APACHE_CONF_DIR}/ports.conf
ADD docker/apache-site.conf ${APACHE_CONF_DIR}/sites-available/webapp.conf
ADD docker/apache-site-ssl.conf ${APACHE_CONF_DIR}/sites-available/webapp-ssl.conf
ADD docker/fpm/pool.d/app.conf ${PHP_CONF_DIR}/fpm/pool.d/webapp.conf
ADD docker/fpm/conf.d/app.ini ${PHP_CONF_DIR}/fpm/conf.d/app.ini
RUN a2ensite webapp webapp-ssl && \
service php7.0-fpm reload
###########################################################################################
#
# Image pour le dev.
#
###########################################################################################
FROM unicaen-dev-php7.0-apache
LABEL maintainer="Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>"
WORKDIR /app
ADD . /app
ENV APACHE_CONF_DIR=/etc/apache2 \
PHP_CONF_DIR=/etc/php/7.0
## Installation de packages requis.
RUN apt-get install -y \
sqlite3 \
php7.0-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/webapp.conf
ADD docker/apache-site-ssl.conf ${APACHE_CONF_DIR}/sites-available/webapp-ssl.conf
ADD docker/fpm/pool.d/app.conf ${PHP_CONF_DIR}/fpm/pool.d/webapp.conf
ADD docker/fpm/conf.d/app.ini ${PHP_CONF_DIR}/fpm/conf.d/app.ini
RUN a2ensite webapp webapp-ssl && \
service php7.0-fpm reload
###########################################################################################
#
# Image pour le dev.
#
###########################################################################################
FROM unicaen-dev-php7.1-apache
LABEL maintainer="Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>"
WORKDIR /app
ADD . /app
ENV APACHE_CONF_DIR=/etc/apache2 \
PHP_CONF_DIR=/etc/php/7.1
## Installation de packages requis.
RUN apt-get install -y \
sqlite3 \
php7.1-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/webapp.conf
ADD docker/apache-site-ssl.conf ${APACHE_CONF_DIR}/sites-available/webapp-ssl.conf
ADD docker/fpm/pool.d/app.conf ${PHP_CONF_DIR}/fpm/pool.d/webapp.conf
ADD docker/fpm/conf.d/app.ini ${PHP_CONF_DIR}/fpm/conf.d/app.ini
RUN a2ensite webapp webapp-ssl && \
service php7.1-fpm reload
###########################################################################################
#
# Image pour le dev.
#
###########################################################################################
FROM unicaen-dev-php7.2-apache
LABEL maintainer="Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>"
WORKDIR /app
ADD . /app
ENV APACHE_CONF_DIR=/etc/apache2 \
PHP_CONF_DIR=/etc/php/7.2
## Installation de packages requis.
RUN apt-get install -y \
sqlite3 \
php7.2-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/webapp.conf
ADD docker/apache-site-ssl.conf ${APACHE_CONF_DIR}/sites-available/webapp-ssl.conf
ADD docker/fpm/pool.d/app.conf ${PHP_CONF_DIR}/fpm/pool.d/webapp.conf
ADD docker/fpm/conf.d/app.ini ${PHP_CONF_DIR}/fpm/conf.d/app.ini
RUN a2ensite webapp webapp-ssl && \
service php7.2-fpm reload
###########################################################################################
#
# Image pour le dev.
#
###########################################################################################
FROM unicaen-dev-php7.3-apache
LABEL maintainer="Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>"
WORKDIR /app
ADD . /app
ENV APACHE_CONF_DIR=/etc/apache2 \
PHP_CONF_DIR=/etc/php/7.3
## Installation de packages requis.
RUN apt-get install -y \
sqlite3 \
php7.3-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/webapp.conf
ADD docker/apache-site-ssl.conf ${APACHE_CONF_DIR}/sites-available/webapp-ssl.conf
ADD docker/fpm/pool.d/app.conf ${PHP_CONF_DIR}/fpm/pool.d/webapp.conf
ADD docker/fpm/conf.d/app.ini ${PHP_CONF_DIR}/fpm/conf.d/app.ini
RUN a2ensite webapp webapp-ssl && \
service php7.3-fpm reload
......@@ -4,6 +4,7 @@ services:
skeleton-application:
container_name: skeleton-application-container
build:
dockerfile: Dockerfile-7.2
context: .
ports:
- "8880:80"
......
<VirtualHost *:443>
ServerName localhost
DocumentRoot /var/www/webapp/public
DocumentRoot /app/public
SetEnv APPLICATION_ENV "development"
RewriteEngine On
<Directory /var/www/webapp/public>
<Directory /app/public>
DirectoryIndex index.php
AllowOverride All
Require all granted
......
<VirtualHost *:80>
ServerName localhost
DocumentRoot /var/www/webapp/public
DocumentRoot /app/public
RewriteEngine On
......
Markdown is supported
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