Advertisement
ferdn4ndo

Dockerfile

Jul 25th, 2018
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. FROM php:7.2-apache
  2. LABEL maintainer="xxx@yyy.com"
  3.  
  4. ENV PHP_EXTRA_CONFIGURE_ARGS="--enable-mailparse"
  5.  
  6. # Install packages
  7. RUN apt-get update && apt-get install -y \
  8. libfreetype6-dev \
  9. libjpeg62-turbo-dev \
  10. libmcrypt-dev \
  11. libpng-dev \
  12. nano \
  13. libc-client-dev libkrb5-dev \
  14. && apt-get clean \
  15. && rm -rf /var/lib/apt/lists/* \
  16. && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
  17. && docker-php-ext-install -j$(nproc) gd \
  18. && pecl config-set php_ini "${PHP_INI_DIR}/php.ini" \
  19. && pecl install mailparse \
  20. && docker-php-ext-enable mailparse \
  21. && docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
  22. && docker-php-ext-install imap \
  23. && yes | pecl install xdebug \
  24. && echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
  25. && docker-php-ext-install mysqli \
  26. && pecl install mcrypt-1.0.1 \
  27. && docker-php-ext-enable mcrypt
  28.  
  29. # Enable apache mods.
  30. RUN a2enmod rewrite
  31.  
  32. # Manually set up the apache environment variables
  33. ENV APACHE_RUN_USER www-data
  34. ENV APACHE_RUN_GROUP www-data
  35. ENV APACHE_LOG_DIR /var/log/apache2
  36. ENV APACHE_LOCK_DIR /var/lock/apache2
  37. ENV APACHE_PID_FILE /var/run/apache2.pid
  38.  
  39. # Replace container php.ini by custom one
  40. COPY config/php.ini /usr/local/etc/php/
  41.  
  42. # Construct server files inside container
  43. COPY app/ /var/www/html/
  44.  
  45. # Set folder permission
  46. RUN chown -R www-data:www-data /var/www/html/
  47.  
  48. # Expose Apache and xDebug
  49. EXPOSE 80
  50. EXPOSE 9000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement