Dockerfile 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. #
  2. #--------------------------------------------------------------------------
  3. # Image Setup
  4. #--------------------------------------------------------------------------
  5. #
  6. ARG PHP_VERSION=${PHP_VERSION}
  7. FROM php:${PHP_VERSION}-alpine
  8. LABEL maintainer="Mahmoud Zalt <mahmoud@zalt.me>"
  9. RUN apk --update add wget \
  10. curl \
  11. git \
  12. build-base \
  13. libmemcached-dev \
  14. libmcrypt-dev \
  15. libxml2-dev \
  16. zlib-dev \
  17. autoconf \
  18. cyrus-sasl-dev \
  19. libgsasl-dev \
  20. supervisor
  21. RUN docker-php-ext-install mysqli mbstring pdo pdo_mysql tokenizer xml pcntl
  22. RUN pecl channel-update pecl.php.net && pecl install memcached mcrypt-1.0.1 && docker-php-ext-enable memcached
  23. #Install SOAP package:
  24. ARG INSTALL_SOAP=false
  25. RUN if [ ${INSTALL_SOAP} = true ]; then \
  26. docker-php-ext-install soap \
  27. ;fi
  28. #Install BCMath package:
  29. ARG INSTALL_BCMATH=false
  30. RUN if [ ${INSTALL_BCMATH} = true ]; then \
  31. docker-php-ext-install bcmath \
  32. ;fi
  33. # Install PostgreSQL drivers:
  34. ARG INSTALL_PGSQL=false
  35. RUN if [ ${INSTALL_PGSQL} = true ]; then \
  36. apk --update add postgresql-dev \
  37. && docker-php-ext-install pdo_pgsql \
  38. ;fi
  39. # Install ZipArchive:
  40. ARG INSTALL_ZIP_ARCHIVE=false
  41. RUN if [ ${INSTALL_ZIP_ARCHIVE} = true ]; then \
  42. apk --update add libzip-dev && \
  43. docker-php-ext-configure zip --with-libzip && \
  44. # Install the zip extension
  45. docker-php-ext-install zip \
  46. ;fi
  47. RUN rm /var/cache/apk/* \
  48. && mkdir -p /var/www
  49. #
  50. #--------------------------------------------------------------------------
  51. # Optional Supervisord Configuration
  52. #--------------------------------------------------------------------------
  53. #
  54. # Modify the ./supervisor.conf file to match your App's requirements.
  55. # Make sure you rebuild your container with every change.
  56. #
  57. COPY supervisord.conf /etc/supervisord.conf
  58. ENTRYPOINT ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisord.conf"]
  59. #
  60. #--------------------------------------------------------------------------
  61. # Optional Software's Installation
  62. #--------------------------------------------------------------------------
  63. #
  64. # If you need to modify this image, feel free to do it right here.
  65. #
  66. # -- Your awesome modifications go here -- #
  67. #
  68. #--------------------------------------------------------------------------
  69. # Check PHP version
  70. #--------------------------------------------------------------------------
  71. #
  72. RUN php -v | head -n 1 | grep -q "PHP ${PHP_VERSION}."
  73. #
  74. #--------------------------------------------------------------------------
  75. # Final Touch
  76. #--------------------------------------------------------------------------
  77. #
  78. WORKDIR /etc/supervisor/conf.d/