\chapter{Dockerfile GLPI}
\label{chap:dockerfile}

\begin{lstlisting}[language=bash, caption={ 
    Dockerfile pour la mise en place de GLPI écrite à 4 mains.
}]
FROM nginx
EXPOSE 80

RUN mkdir -p /var/www/html
# Copy Nginx conf & GLPI data
COPY nginx/ /etc/nginx/
COPY html/ /var/www/html/
COPY cron/ /var/spool/cron/crontabs/

# Copy entrypoint scripts
COPY 40-start-services.sh /docker-entrypoint.d
COPY 50-config.sh /docker-entrypoint.d

# Install PHP dependancies
RUN chown -R www-data:www-data /var/www/html/ && \
FROM nginx
EXPOSE 80

RUN mkdir -p /var/www/html

# Copy Nginx conf & GLPI data
COPY nginx/ /etc/nginx/
COPY html/ /var/www/html/
COPY cron/ /var/spool/cron/crontabs/

# Copy entrypoint scripts
COPY 40-start-services.sh /docker-entrypoint.d
COPY 50-config.sh /docker-entrypoint.d

# Install PHP dependancies
RUN chown -R www-data:www-data /var/www/html/ && \
    apt update -y && \
    apt install -y php-fpm php-curl php-common php-gd php-json php-mbstring \
        php-mysql php-zip php-xml php-intl php-apcu php-bz2 php-cas php-xmlrpc \
        php-ldap && \
    apt install --no-install-recommends -y cron && \
    ls -la /var/spool/cron/* && \
    chown www-data:crontab /var/spool/cron/crontabs/www-data && \
    chmod 600 /var/spool/cron/crontabs/www-data   apt update -y && \
    apt install -y php-fpm php-curl php-common php-gd php-json php-mbstring \
    php-mysql php-zip php-xml php-intl php-apcu php-bz2 php-cas php-xmlrpc php-ldap && \
    apt install --no-install-recommends -y cron && \
    chown www-data:crontab /var/spool/cron/crontabs/www-data && \
    chmod 600 /var/spool/cron/crontabs/www-data
\end{lstlisting}
