Dockerfile 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. # Use Alpine Linux
  2. FROM alpine:latest
  3. # Maintainer
  4. MAINTAINER Muhammad Zamroni <halo@matriphe.com>
  5. # Environments
  6. ENV TIMEZONE Asia/Jakarta
  7. ENV PHP_MEMORY_LIMIT 512M
  8. ENV MAX_UPLOAD 50M
  9. ENV PHP_MAX_FILE_UPLOAD 200
  10. ENV PHP_MAX_POST 100M
  11. # Let's roll
  12. RUN apk update && \
  13. apk upgrade && \
  14. apk add --update tzdata curl && \
  15. cp /usr/share/zoneinfo/${TIMEZONE} /etc/localtime && \
  16. echo "${TIMEZONE}" > /etc/timezone && \
  17. apk add --update \
  18. php5-mcrypt \
  19. php5-phar \
  20. php5-soap \
  21. php5-openssl \
  22. php5-gmp \
  23. php5-pdo_odbc \
  24. php5-json \
  25. php5-dom \
  26. php5-pdo \
  27. php5-zip \
  28. php5-mysql \
  29. php5-sqlite3 \
  30. php5-apcu \
  31. php5-pdo_pgsql \
  32. php5-bcmath \
  33. php5-gd \
  34. php5-xcache \
  35. php5-odbc \
  36. php5-pdo_mysql \
  37. php5-pdo_sqlite \
  38. php5-gettext \
  39. php5-xmlreader \
  40. php5-xmlrpc \
  41. php5-bz2 \
  42. php5-memcache \
  43. php5-mssql \
  44. php5-iconv \
  45. php5-pdo_dblib \
  46. php5-curl \
  47. php5-ctype \
  48. php5-phar \
  49. php5-cli && \
  50. # Set environments
  51. sed -i "s|;*date.timezone =.*|date.timezone = ${TIMEZONE}|i" /etc/php5/php.ini && \
  52. sed -i "s|;*memory_limit =.*|memory_limit = ${PHP_MEMORY_LIMIT}|i" /etc/php5/php.ini && \
  53. sed -i "s|;*upload_max_filesize =.*|upload_max_filesize = ${MAX_UPLOAD}|i" /etc/php5/php.ini && \
  54. sed -i "s|;*max_file_uploads =.*|max_file_uploads = ${PHP_MAX_FILE_UPLOAD}|i" /etc/php5/php.ini && \
  55. sed -i "s|;*post_max_size =.*|post_max_size = ${PHP_MAX_POST}|i" /etc/php5/php.ini && \
  56. sed -i "s|;*cgi.fix_pathinfo=.*|cgi.fix_pathinfo= 0|i" /etc/php5/php.ini && \
  57. # Cleaning up
  58. mkdir /www && \
  59. apk del tzdata && \
  60. rm -rf /var/cache/apk/*
  61. RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
  62. RUN composer config --global github-protocols
  63. COPY . /export/htdocs/
  64. COPY ./conf/php.ini /etc/php/
  65. COPY ./conf/php-fpm.conf /etc/php/
  66. # Set Workdir
  67. WORKDIR /www
  68. # Expose volumes
  69. VOLUME ["/www"]
  70. # Expose ports
  71. EXPOSE 9000
  72. # Entry point
  73. CMD sh -c 'while true; do echo hello world > /dev/null; sleep 1; done'