Dockerfile 1.11 KB
Newer Older
1
2
3
ARG PHP_VERSION

FROM unicaen-dev-php${PHP_VERSION}-apache
4
5
6

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

7
8
WORKDIR /app

9
ENV APACHE_CONF_DIR=/etc/apache2 \
10
    PHP_CONF_DIR=/etc/php/${PHP_VERSION}
11
12

## Installation de packages requis.
13
14
RUN apt-get update -qq && \
    apt-get install -y \
15
        php${PHP_VERSION}-pgsql
16
17
18
19
20
21
22
23
24
25
26

# 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
27
28
29
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
30
ADD docker/fpm/conf.d/app.ini   ${PHP_CONF_DIR}/fpm/conf.d/app.ini
31

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