No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Dockerfile 4.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. FROM debian:stretch
  2. LABEL maintainer="Pascal <pascal.pelissier@logipro.com>"
  3. #
  4. # Step 1: Installation
  5. #
  6. # Set frontend. We'll clean this later on!
  7. ENV DEBIAN_FRONTEND noninteractive
  8. # Locale
  9. ENV LOCALE fr_FR.UTF-8
  10. # Default Document root.
  11. ENV DEFAULT_ROOT=/var/www/html
  12. ARG UID=1000
  13. ARG GID=1000
  14. ARG UNAME=logiproop
  15. # Set repositories
  16. RUN \
  17. echo "deb http://ftp.fr.debian.org/debian/ stretch main non-free contrib" > /etc/apt/sources.list && \
  18. echo "deb-src http://ftp.fr.debian.org/debian/ stretch main non-free contrib" >> /etc/apt/sources.list && \
  19. echo "deb http://security.debian.org/ stretch/updates main contrib non-free" >> /etc/apt/sources.list && \
  20. echo "deb-src http://security.debian.org/ stretch/updates main contrib non-free" >> /etc/apt/sources.list && \
  21. apt-get -qq update && apt-get -qqy upgrade
  22. # Install some basic tools needed for deployment
  23. RUN apt-get -yqq install \
  24. apt-utils \
  25. build-essential \
  26. debconf-utils \
  27. debconf \
  28. mysql-client \
  29. locales \
  30. curl \
  31. wget \
  32. unzip \
  33. patch \
  34. rsync \
  35. vim \
  36. nano \
  37. openssh-client \
  38. git \
  39. bash-completion \
  40. locales \
  41. libjpeg-turbo-progs libjpeg-progs \
  42. pngcrush optipng
  43. # Install locale
  44. RUN \
  45. sed -i -e "s/# $LOCALE/$LOCALE/" /etc/locale.gen && \
  46. echo "LANG=$LOCALE">/etc/default/locale && \
  47. dpkg-reconfigure --frontend=noninteractive locales && \
  48. update-locale LANG=$LOCALE
  49. # Configure Sury sources
  50. # @see https://www.noobunbox.net/serveur/auto-hebergement/installer-php-7-1-sous-debian-et-ubuntu
  51. RUN \
  52. apt-get -yqq install apt-transport-https lsb-release ca-certificates && \
  53. wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg && \
  54. echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list && \
  55. apt-get -qq update && apt-get -qqy upgrade
  56. # Install PHP7 with Xdebug (dev environment)
  57. RUN apt-get -yqq install \
  58. php7.2 \
  59. php7.2-curl \
  60. php7.2-bcmath \
  61. php7.2-bz2 \
  62. php7.2-dev \
  63. php7.2-gd \
  64. php7.2-dom \
  65. php7.2-imap \
  66. php7.2-imagick \
  67. php7.2-intl \
  68. php7.2-json \
  69. php7.2-ldap \
  70. php7.2-mbstring \
  71. php7.2-mysql \
  72. php7.2-oauth \
  73. php7.2-odbc \
  74. php7.2-uploadprogress \
  75. php7.2-ssh2 \
  76. php7.2-xml \
  77. php7.2-zip \
  78. php7.2-solr \
  79. php7.2-apcu \
  80. php7.2-opcache \
  81. php7.2-memcache \
  82. php7.2-memcached \
  83. php7.2-redis \
  84. php7.2-xdebug \
  85. php7.2-pspell \
  86. php7.2-xsl \
  87. libapache2-mod-php7.2
  88. # Install manually APC
  89. RUN \
  90. echo "extension=apcu.so" > /etc/php/7.2/mods-available/apcu_bc.ini && \
  91. echo "extension=apc.so" >> /etc/php/7.2/mods-available/apcu_bc.ini
  92. # Install SMTP.
  93. RUN apt-get install -y ssmtp
  94. # Install Apache web server.
  95. RUN apt-get -yqq install apache2
  96. #
  97. # Step 2: Configuration
  98. #
  99. # Enable uploadprogress, imagick, redis and solr.
  100. RUN phpenmod uploadprogress imagick redis solr
  101. # Disable by default apcu, apcu_bc, opcache, xdebug and xhprof. Use docker-compose.yml to add file.
  102. RUN phpdismod apcu apcu_bc opcache xdebug xhprof
  103. # Remove all sites enabled
  104. # RUN rm /etc/apache2/sites-enabled/*
  105. # Configure needed apache modules and disable default site
  106. RUN a2dismod mpm_event cgi # mpm_worker enabled.
  107. RUN a2enmod \
  108. access_compat \
  109. actions \
  110. alias \
  111. auth_basic \
  112. authn_core \
  113. authn_file \
  114. authz_core \
  115. authz_groupfile \
  116. authz_host \
  117. authz_user \
  118. autoindex \
  119. dir \
  120. env \
  121. expires \
  122. filter \
  123. headers \
  124. mime \
  125. negotiation \
  126. php7.2 \
  127. mpm_prefork \
  128. reqtimeout \
  129. rewrite \
  130. setenvif \
  131. status \
  132. ssl
  133. # without the following line we get "AH00558: apache2: Could not reliably determine the server's fully qualified domain name"
  134. # autorise .htaccess files
  135. RUN \
  136. sed -i '/<Directory \/var\/www\/>/,/<\/Directory>/ s/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf
  137. # Install composer (latest version) | prestissimo to speed up composer
  138. RUN curl -sS https://getcomposer.org/installer | php && \
  139. mv composer.phar /usr/local/bin/composer && \
  140. composer global require "hirak/prestissimo:^0.3"
  141. # Bash setup.
  142. RUN echo ". /usr/share/bash-completion/bash_completion" >> ~/.bashrc && echo "alias ll='ls -lahs'" >> ~/.bashrc
  143. #
  144. # Step 3: Clean the system
  145. #
  146. # Cleanup some things.
  147. RUN apt-get -q autoclean && \
  148. rm -rf /var/lib/apt/lists/*
  149. #
  150. # Step 4: Run
  151. #
  152. # Create 'logiproop' user like local machime user.
  153. RUN \
  154. groupadd -g $UID $GID ; \
  155. useradd -m -u $UID -g $GID -s /bin/bash $UNAME ; \
  156. usermod -aG www-data $UNAME; \
  157. echo ". /usr/share/bash-completion/bash_completion" >> ~/.bashrc && echo "alias ll='ls -lahs'" >> /home/$UNAME/.bashrc
  158. # Working dir
  159. WORKDIR ${DEFAULT_ROOT}
  160. # Configure templates
  161. COPY scripts/apache2-foreground /usr/bin/
  162. EXPOSE 80 443
  163. CMD ["apache2-foreground"]