Dockerfile 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # php7-base
  2. #
  3. # VERSION 0.1
  4. FROM ronnicek/alpine:latest
  5. # Create user + group & Base packages
  6. RUN addgroup -g 6662 php && adduser -u 6662 -H -s /sbin/nologin -G php -D php && \
  7. echo "http://nl.alpinelinux.org/alpine/v3.8/community" >> /etc/apk/repositories && \
  8. echo "http://nl.alpinelinux.org/alpine/v3.8/main" >> /etc/apk/repositories && \
  9. apk --update add php7-mcrypt \
  10. php7-soap \
  11. php7-openssl \
  12. php7-gmp \
  13. php7-pdo_odbc \
  14. php7-json \
  15. php7-dom \
  16. php7-pdo \
  17. php7-zip \
  18. php7-mysqlnd \
  19. php7-mysqli \
  20. php7-sqlite3 \
  21. php7-apcu \
  22. php7-pdo_pgsql \
  23. php7-bcmath \
  24. php7-gd \
  25. php7-opcache \
  26. php7-odbc \
  27. php7-pdo_mysql \
  28. php7-pdo_sqlite \
  29. php7-gettext \
  30. php7-xmlreader \
  31. php7-xmlwriter \
  32. php7-simplexml \
  33. php7-xml \
  34. php7-xmlrpc \
  35. php7-bz2 \
  36. php7-mbstring \
  37. php7-iconv \
  38. php7-curl \
  39. php7-ctype \
  40. php7-zlib \
  41. php7-session \
  42. php7-fpm \
  43. php7-fileinfo \
  44. php7 \
  45. msmtp \
  46. php7-intl \
  47. php7-posix && \
  48. rm -rf /var/cache/apk/*
  49. # set recommended PHP.ini settings
  50. # see https://secure.php.net/manual/en/opcache.installation.php
  51. RUN set -xe && \
  52. cd /etc/php7/ && \
  53. sed 's/;include=/include=/g' php-fpm.conf > php-fpm.conf.bak && \
  54. sed 's/;daemonize = yes/daemonize = no/g' php-fpm.conf.bak > php-fpm.conf && \
  55. cd /etc/php7/php-fpm.d/ && \
  56. sed 's/listen = 127.0.0.1:9000/listen = [::]:9000/g' www.conf > www.conf.bak && \
  57. sed 's/;env/env/g' www.conf.bak > www.conf && \
  58. sed 's/;access.log = log\/php7\/$pool.access.log/access.log = \/proc\/self\/fd\/2/g' www.conf > www.conf.bak && \
  59. mv www.conf.bak www.conf && \
  60. chown -R php:php /var/log/php7 && \
  61. echo 'opcache.memory_consumption=128' >> /etc/php7/conf.d/opcache-recommended.ini && \
  62. echo 'opcache.interned_strings_buffer=8' >> /etc/php7/conf.d/opcache-recommended.ini && \
  63. echo 'opcache.max_accelerated_files=10000' >> /etc/php7/conf.d/opcache-recommended.ini && \
  64. echo 'opcache.revalidate_freq=1' >> /etc/php7/conf.d/opcache-recommended.ini && \
  65. echo 'opcache.fast_shutdown=1' >> /etc/php7/conf.d/opcache-recommended.ini && \
  66. echo 'opcache.enable_cli=1' >> /etc/php7/conf.d/opcache-recommended.ini && \
  67. echo 'opcache.enable=1' >> /etc/php7/conf.d/opcache-recommended.ini && \
  68. echo 'opcache.save_comments=1' >> /etc/php7/conf.d/opcache-recommended.ini
  69. echo 'sendmail_path = "/usr/bin/msmtp -t -i"' >> /etc/php7/conf.d/mail.ini
  70. USER php
  71. EXPOSE 9000
  72. CMD ["/usr/sbin/php-fpm7"]