first commit
This commit is contained in:
114
containers/loginapp/Dockerfile
Normal file
114
containers/loginapp/Dockerfile
Normal file
@ -0,0 +1,114 @@
|
||||
FROM ubuntu:20.04
|
||||
|
||||
ARG HTTP_PROXY=
|
||||
ARG HTTPS_PROXY=
|
||||
ARG http_proxy=
|
||||
ARG https_proxy=
|
||||
|
||||
ENV WAITFORIT_VERSION="v2.4.1"
|
||||
|
||||
ARG PHP_VERSION="8.1"
|
||||
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 \
|
||||
mutt tree vim python python3 python3-setuptools python3-pip make \
|
||||
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 \
|
||||
php${PHP_VERSION}-ssh2 libxml2-utils \
|
||||
locales \
|
||||
apache2 \
|
||||
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
|
||||
|
||||
VOLUME /loginapp
|
||||
VOLUME /loginapp/var/logs
|
||||
VOLUME /loginapp/var/cache
|
||||
|
||||
# Install composer
|
||||
COPY install-composer.sh /root/install-composer.sh
|
||||
RUN chmod +x /root/install-composer.sh &&\
|
||||
/root/install-composer.sh &&\
|
||||
rm -f /root/install-composer.sh
|
||||
|
||||
# On active les mods d'apache nécessaires
|
||||
RUN a2enmod rewrite
|
||||
RUN a2enmod proxy_fcgi setenvif
|
||||
RUN a2enconf php8.1-fpm
|
||||
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
|
||||
COPY www.conf /etc/php/8.1/fpm/pool.d/www.conf
|
||||
|
||||
# Allow passing of environment variables to PHP
|
||||
# Used in web/app_dev.php to detect docker-compose environment
|
||||
RUN for i in /etc/php/*; do mkdir -p $i/cli/conf.d; echo 'variables_order = "EGPCS"' > $i/cli/conf.d/mse.ini; done;
|
||||
|
||||
EXPOSE 5000
|
||||
EXPOSE 80
|
||||
|
||||
WORKDIR /loginapp
|
||||
|
||||
# Flag to allow access to app_dev.php from Docker host
|
||||
ENV MSE_DOCKER_COMPOSER_DEVELOPMENT=yes
|
||||
|
||||
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
|
||||
|
||||
# On crée un point d'entrée non restrictif et non tracké pour être utilisé par apache
|
||||
COPY app_docker.php /root/app_docker.php
|
||||
|
||||
# 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
|
||||
|
||||
COPY rsyslog.conf /etc/rsyslog.d/loginapp.conf
|
||||
COPY supervisor.ini /etc/supervisor/supervisor.ini
|
||||
COPY php.ini /etc/php/7.4/fpm/php.ini
|
||||
|
||||
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"]
|
Reference in New Issue
Block a user