Dockerfile 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. FROM alpine:3.6
  2. LABEL maintainer "Andre Peters <andre.peters@servercow.de>"
  3. # Add script
  4. COPY docker-entrypoint.sh /
  5. # Add group + user - 82 is the standard uid/gid for "www-data" in Alpine
  6. RUN set -x \
  7. && addgroup -g 82 -S www-data \
  8. && adduser -u 82 -D -S -G www-data www-data \
  9. \
  10. # Install Dependencies
  11. && apk add --update \
  12. && apk add --no-cache bash php7-fpm php7-intl php7-pdo php7-pdo_mysql php7-xmlrpc php7-redis php7-pear \
  13. php7-pear-auth_sasl php7-pear-net_smtp php7-pear-net_idna2 php7-pear-mail_mime \
  14. && pear install Net_IMAP \
  15. # MISSING apk for php7-pear-net_imap - can be installed once https://github.com/alpinelinux/aports/pull/1359 is merged.
  16. \
  17. # Configuring php-fpm
  18. && set -ex \
  19. && cd /etc/php7/ \
  20. # Change the setting so the daemon runs in the foreground and as www-data:www-data
  21. #&& sed -i 's/^;daemonize .*$/daemonize = no/g' /etc/php7/php-fpm.conf \
  22. && sed -i 's/^user = .*/user = www-data/' /etc/php7/php-fpm.d/www.conf \
  23. && sed -i 's/^group = .*/group = www-data/' /etc/php7/php-fpm.d/www.conf \
  24. && { \
  25. echo '[global]'; \
  26. echo 'error_log = /proc/self/fd/2'; \
  27. echo; \
  28. echo '[www]'; \
  29. echo '; if we send this to /proc/self/fd/1, it never appears'; \
  30. echo 'access.log = /proc/self/fd/2'; \
  31. echo; \
  32. echo 'clear_env = no'; \
  33. echo; \
  34. echo '; Ensure worker stdout and stderr are sent to the main error log.'; \
  35. echo 'catch_workers_output = yes'; \
  36. } | tee php-fpm.d/docker.conf \
  37. && { \
  38. echo '[global]'; \
  39. echo 'daemonize = no'; \
  40. echo; \
  41. echo '[www]'; \
  42. echo 'listen = [::]:9000'; \
  43. } | tee php-fpm.d/zz-docker.conf
  44. EXPOSE 9000
  45. # Time to milk the cows ;)
  46. ENTRYPOINT ["/docker-entrypoint.sh"]
  47. CMD ["php-fpm7"]