TEXT   55

Dockerfile

Guest on 28th June 2022 09:57:25 AM

  1. FROM php:7.3-apache
  2.  
  3. ENV PHP_INI_DATE_TIMEZONE 'UTC'
  4. ENV PHP_INI_MEMORY_LIMIT 256M
  5.  
  6. RUN apt-get update -y \
  7.     && apt-get install -y --no-install-recommends \
  8.         libfreetype6-dev \
  9.         libjpeg62-turbo-dev \
  10.         libjpeg62-turbo \
  11.         libpng-dev \
  12.         libpng16-16 \
  13.         libldap2-dev \
  14.         libxml2-dev \
  15.         libzip-dev \
  16.         zlib1g-dev \
  17.         libicu-dev \
  18.         g++ \
  19.         default-mysql-client \
  20.         unzip \
  21.         curl \
  22.         apt-utils \
  23.         msmtp \
  24.         msmtp-mta \
  25.         mailutils \
  26.     && apt-get autoremove -y \
  27.     && rm -rf /var/lib/apt/lists/* \
  28.     && docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
  29.     && docker-php-ext-install -j$(nproc) calendar intl mysqli pdo_mysql gd soap zip \
  30.     && docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \
  31.     && docker-php-ext-install -j$(nproc) ldap && \
  32.     mv ${PHP_INI_DIR}/php.ini-development ${PHP_INI_DIR}/php.ini
  33.  
  34. RUN mkdir /var/documents
  35. RUN chown www-data:www-data /var/documents
  36.  
  37. COPY docker-run.sh /usr/local/bin/
  38. RUN chmod +x /usr/local/bin/docker-run.sh
  39.  
  40. RUN pecl install xdebug && docker-php-ext-enable xdebug
  41. RUN echo 'zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20180731/xdebug.so"' >> ${PHP_INI_DIR}/php.ini
  42. RUN echo 'xdebug.remote_autostart=1' >> ${PHP_INI_DIR}/php.ini
  43. RUN echo 'xdebug.remote_enable=1' >> ${PHP_INI_DIR}/php.ini
  44. RUN echo 'xdebug.default_enable=1' >> ${PHP_INI_DIR}/php.ini
  45. #RUN echo 'xdebug.remote_host=docker.host' >> ${PHP_INI_DIR}/php.ini
  46. RUN echo 'xdebug.remote_port=9000' >> ${PHP_INI_DIR}/php.ini
  47. RUN echo 'xdebug.remote_connect_back=1' >> ${PHP_INI_DIR}/php.ini
  48. RUN echo 'xdebug.profiler_enable=0' >> ${PHP_INI_DIR}/php.ini
  49. RUN echo 'xdebug.remote_log="/tmp/xdebug.log"' >> ${PHP_INI_DIR}/php.ini
  50. #RUN echo 'localhost docker.host' >> /etc/hosts
  51.  
  52. # set up sendmail config, to use maildev
  53. RUN echo "account default" > /etc/msmtprc
  54. RUN echo "auth off" >> /etc/msmtprc
  55. RUN echo "port 25" >> /etc/msmtprc
  56. RUN echo "host mail" >> /etc/msmtprc
  57. RUN echo "from local@localdomain.com" >> /etc/msmtprc
  58. RUN echo "domain localhost.localdomain" >> /etc/msmtprc
  59. RUN echo "sendmail_path=/usr/bin/msmtp -t" >> /usr/local/etc/php/conf.d/php-sendmail.ini
  60. RUN echo "localhost localhost.localdomain" >> /etc/hosts
  61.  
  62. EXPOSE 80
  63.  
  64. ENTRYPOINT ["docker-run.sh"]

Raw Paste


Login or Register to edit or fork this paste. It's free.