Dockerfile 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 PostgreSQL drivers:
  24. ARG INSTALL_PGSQL=false
  25. RUN if [ ${INSTALL_PGSQL} = true ]; then \
  26. apk --update add postgresql-dev \
  27. && docker-php-ext-install pdo_pgsql \
  28. ;fi
  29. RUN rm /var/cache/apk/* \
  30. && mkdir -p /var/www
  31. #
  32. #--------------------------------------------------------------------------
  33. # Optional Supervisord Configuration
  34. #--------------------------------------------------------------------------
  35. #
  36. # Modify the ./supervisor.conf file to match your App's requirements.
  37. # Make sure you rebuild your container with every change.
  38. #
  39. COPY supervisord.conf /etc/supervisord.conf
  40. ENTRYPOINT ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisord.conf"]
  41. #
  42. #--------------------------------------------------------------------------
  43. # Optional Software's Installation
  44. #--------------------------------------------------------------------------
  45. #
  46. # If you need to modify this image, feel free to do it right here.
  47. #
  48. # -- Your awesome modifications go here -- #
  49. #
  50. #--------------------------------------------------------------------------
  51. # Check PHP version
  52. #--------------------------------------------------------------------------
  53. #
  54. RUN php -v | head -n 1 | grep -q "PHP ${PHP_VERSION}."
  55. #
  56. #--------------------------------------------------------------------------
  57. # Final Touch
  58. #--------------------------------------------------------------------------
  59. #
  60. WORKDIR /etc/supervisor/conf.d/