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

Docker : utilisation des images sygal-image-php7.3 et sygal-import-ws-php7.0

parent 22220282
Loading
Loading
Loading
Loading

.dockerignore

deleted100644 → 0
+0 −3
Original line number Diff line number Diff line
# On exclue tout car on utilisera un montage de volume lors du "docker run" pour déployer nos sources.
# Seul le fichier "apache.conf" est inclus dans le contexte.
vendor

Dockerfile

deleted100644 → 0
+0 −40
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>"

## Installation de packages requis.
RUN apt-get update -qq && \
    apt-get install -y \
        ghostscript-x \
        php${PHP_VERSION}-imagick \
        imagemagick

# 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, PHP 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/php/fpm/pool.d/www.conf   ${PHP_CONF_DIR}/fpm/pool.d/
ADD docker/php/fpm/conf.d/99-app.ini ${PHP_CONF_DIR}/fpm/conf.d/
ADD docker/php/cli/conf.d/99-app.ini ${PHP_CONF_DIR}/cli/conf.d/

# Copie des scripts complémentaires à lancer au démarrage du container
COPY docker/entrypoint.d/* /entrypoint.d/

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

Dockerfile.sh

deleted100755 → 0
+0 −58
Original line number Diff line number Diff line
#!/usr/bin/env bash

#
# Script d'install d'un serveur, traduction du Dockerfile.
#

usage() {
  cat << EOF
Script d'install d'un serveur, traduction du Dockerfile.
Usage: $0 <version de PHP>
EOF
  exit 0;
}

[[ -z "$1" ]] && usage

################################################################################################################

PHP_VERSION="$1"
SYGAL_DIR=$(cd `dirname $0` && pwd)

set -e

# Minimum vital
apt-get -qq update && \
apt-get install -y \
    git \
    nano \
    ghostscript-x \
    php${PHP_VERSION}-imagick \
    imagemagick

# Récupération de l'image Docker Unicaen et lancement de son Dockerfile.sh
export UNICAEN_IMAGE_TMP_DIR=/tmp/docker-unicaen-image
git clone https://git.unicaen.fr/open-source/docker/unicaen-image.git ${UNICAEN_IMAGE_TMP_DIR}
cd ${UNICAEN_IMAGE_TMP_DIR}
. Dockerfile.sh ${PHP_VERSION}


cd ${SYGAL_DIR}

# NB: Variables d'env exportées par ${UNICAEN_IMAGE_TMP_DIR}/Dockerfile.sh
# APACHE_CONF_DIR=/etc/apache2
# PHP_CONF_DIR="/etc/php/$1"

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

sed -i -re 's/SetEnv APPLICATION_ENV "(development|test)"/SetEnv APPLICATION_ENV "production"/' \
    ${APACHE_CONF_DIR}/sites-available/app-ssl.conf

a2ensite app app-ssl && \
    service apache2 reload && \
    service php${PHP_VERSION}-fpm reload
+9 −12
Original line number Diff line number Diff line
@@ -2,13 +2,10 @@ version: '2.2'

services:
  sygal:
    container_name: sygal-container
    image: sygal-image-php7.3
    container_name: sygal-container-php7.3
    depends_on:
      - sygal-import-ws
    build:
      args:
        PHP_VERSION: 7.3
      context: .
    environment:
      - http_proxy
      - https_proxy
@@ -24,13 +21,13 @@ services:
      - sygalnet

  sygal-import-ws:
    container_name: sygal-import-ws-container
    build:
      context: ../sygal-import-ws
      args:
        PHP_VERSION: 7.0
    image: sygal-import-ws-image-php7.0
    container_name: sygal-import-ws-container-php7.0
    environment:
      - http_proxy
      - https_proxy
      - no_proxy
    ports:
     - "8080:80"
     - "8443:443"
    volumes:
     - ../sygal-import-ws:/app

docker/apache-ports.conf

deleted100644 → 0
+0 −2
Original line number Diff line number Diff line
Listen 80
Listen 443
Loading