2022-04-07 14:35:36 +02:00
|
|
|
FROM ubuntu:22.04
|
2022-04-07 11:49:17 +02:00
|
|
|
|
|
|
|
ARG HTTP_PROXY=
|
|
|
|
ARG HTTPS_PROXY=
|
|
|
|
ARG http_proxy=
|
|
|
|
ARG https_proxy=
|
|
|
|
|
|
|
|
ENV WAITFORIT_VERSION="v2.4.1"
|
|
|
|
|
2022-04-07 14:35:36 +02:00
|
|
|
ARG PHP_VERSION="8.1"
|
2022-04-07 11:49:17 +02:00
|
|
|
ENV PHP_VERSION $PHP_VERSION
|
|
|
|
|
|
|
|
RUN export DEBIAN_FRONTEND=noninteractive && \
|
|
|
|
apt-get update -y && \
|
|
|
|
apt-get install -y software-properties-common && \
|
|
|
|
add-apt-repository ppa:ondrej/php && \
|
|
|
|
apt-get update -y && \
|
|
|
|
apt-get install -y --no-install-recommends \
|
|
|
|
git bash wget ca-certificates supervisor cron rsyslog mysql-client jq \
|
2022-04-07 14:35:36 +02:00
|
|
|
mutt tree vim python3-setuptools python3-pip make \
|
2022-04-07 11:49:17 +02:00
|
|
|
php${PHP_VERSION}-cli php${PHP_VERSION}-ldap php${PHP_VERSION}-soap \
|
|
|
|
php${PHP_VERSION}-intl php${PHP_VERSION}-curl php${PHP_VERSION}-gd \
|
|
|
|
php${PHP_VERSION}-xml php${PHP_VERSION}-bcmath \
|
|
|
|
php${PHP_VERSION}-zip php${PHP_VERSION}-fpm \
|
|
|
|
php${PHP_VERSION}-mbstring \
|
2022-05-03 08:54:45 +02:00
|
|
|
php${PHP_VERSION}-mysql \
|
|
|
|
php${PHP_VERSION}-pdo-mysql \
|
2022-04-07 11:49:17 +02:00
|
|
|
php${PHP_VERSION}-ssh2 libxml2-utils \
|
|
|
|
locales \
|
|
|
|
apache2 \
|
2022-04-22 10:34:56 +02:00
|
|
|
libapache2-mod-fcgid \
|
2022-04-07 11:49:17 +02:00
|
|
|
ssh-client \
|
|
|
|
acl moreutils \
|
|
|
|
sudo
|
|
|
|
|
|
|
|
# Set fr_FR locale
|
|
|
|
RUN sed -i -e 's/# fr_FR.UTF-8 UTF-8/fr_FR.UTF-8 UTF-8/' /etc/locale.gen && \
|
|
|
|
dpkg-reconfigure --frontend=noninteractive locales && \
|
|
|
|
update-locale LANG=fr_FR.UTF-8
|
|
|
|
ENV LC_ALL fr_FR.UTF-8
|
|
|
|
ENV LANG fr_FR.UTF-8
|
|
|
|
ENV LANGUAGE fr_FR.UTF-8
|
|
|
|
|
|
|
|
# Waitforit - Wait for all service is running before launch tests
|
|
|
|
RUN wget -q -O /usr/local/bin/waitforit https://github.com/maxcnunes/waitforit/releases/download/$WAITFORIT_VERSION/waitforit-linux_amd64 \
|
|
|
|
&& chmod +x /usr/local/bin/waitforit
|
|
|
|
|
|
|
|
# Install superfsmon to restart supervisor programs on file changes
|
|
|
|
RUN pip3 install wheel superfsmon
|
|
|
|
|
2022-05-03 08:54:45 +02:00
|
|
|
VOLUME /loginappsql
|
|
|
|
VOLUME /loginappsql/var/logs
|
|
|
|
VOLUME /loginappsql/var/cache
|
2022-04-07 11:49:17 +02:00
|
|
|
|
|
|
|
# Install composer
|
2022-05-03 08:54:45 +02:00
|
|
|
COPY install-composer.sh /loginappsql/install-composer.sh
|
|
|
|
RUN chmod +x /loginappsql/install-composer.sh &&\
|
|
|
|
/loginappsql/install-composer.sh &&\
|
|
|
|
rm -f /loginappsql/install-composer.sh
|
2022-04-07 11:49:17 +02:00
|
|
|
|
|
|
|
# On active les mods d'apache nécessaires
|
|
|
|
RUN a2enmod rewrite
|
|
|
|
RUN a2enmod proxy_fcgi setenvif
|
2022-04-07 14:35:36 +02:00
|
|
|
RUN a2enconf php8.1-fpm
|
2022-04-07 11:49:17 +02:00
|
|
|
RUN a2enmod proxy
|
|
|
|
RUN a2enmod expires
|
|
|
|
RUN a2enmod headers
|
|
|
|
|
|
|
|
# On injecte les bonnes configs apache et php-fpm
|
|
|
|
COPY 000-default.conf /etc/apache2/sites-available/000-default.conf
|
2022-04-07 14:35:36 +02:00
|
|
|
COPY www.conf /etc/php/8.1/fpm/pool.d/www.conf
|
2022-04-07 11:49:17 +02:00
|
|
|
|
|
|
|
EXPOSE 5000
|
|
|
|
EXPOSE 80
|
|
|
|
|
2022-05-03 08:54:45 +02:00
|
|
|
WORKDIR /loginappsql
|
2022-04-07 11:49:17 +02:00
|
|
|
|
2022-04-07 13:07:00 +02:00
|
|
|
# On démarre php-fpm une fois pour créer les sockets
|
2022-04-07 14:35:36 +02:00
|
|
|
RUN service php8.1-fpm start
|
|
|
|
RUN service php8.1-fpm stop
|
2022-04-07 13:07:00 +02:00
|
|
|
|
2022-04-07 11:49:17 +02:00
|
|
|
|
|
|
|
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
|
|
|
RUN chmod +x /docker-entrypoint.sh
|
|
|
|
|
|
|
|
COPY first-run.sh /root/first-run.sh
|
|
|
|
RUN chmod +x /root/first-run.sh
|
|
|
|
|
|
|
|
# Disable rsyslog privileges drop to allow stdout logging
|
|
|
|
RUN sed -i 's/^\$\(PrivDropTo.*\)$/#\1/' /etc/rsyslog.conf
|
|
|
|
RUN sed -i '/imklog/s/^/#/' /etc/rsyslog.conf
|
|
|
|
|
2022-05-03 08:54:45 +02:00
|
|
|
COPY rsyslog.conf /etc/rsyslog.d/loginappsql.conf
|
2022-04-07 11:49:17 +02:00
|
|
|
COPY supervisor.ini /etc/supervisor/supervisor.ini
|
2022-04-07 14:35:36 +02:00
|
|
|
COPY php.ini /etc/php/8.1/fpm/php.ini
|
2022-04-07 11:49:17 +02:00
|
|
|
|
|
|
|
VOLUME /container-lifecycle
|
|
|
|
|
|
|
|
RUN wget -O- https://github.com/boxboat/fixuid/releases/download/v0.5.1/fixuid-0.5.1-linux-amd64.tar.gz | tar -C /usr/local/bin -xzf - \
|
|
|
|
&& chown root:root /usr/local/bin/fixuid \
|
|
|
|
&& chmod 4755 /usr/local/bin/fixuid \
|
|
|
|
&& mkdir -p /etc/fixuid
|
|
|
|
|
|
|
|
COPY fixuid.yml /etc/fixuid/config.yml
|
|
|
|
|
|
|
|
ENTRYPOINT ["/usr/local/bin/fixuid"]
|
|
|
|
|
|
|
|
RUN echo "www-data ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/www-data
|
|
|
|
|
|
|
|
USER www-data
|
|
|
|
|
|
|
|
CMD ["/docker-entrypoint.sh"]
|