You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Dockerfile 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. #ADD https://www.dotdeb.org/dotdeb.gpg /tmp/dotdeb.gpg
  2. #RUN apt-key add /tmp/dotdeb.gpg
  3. #COPY php7.list /etc/apt/sources.list.d
  4. #
  5. #RUN apt-get update &&\
  6. # apt-get -y install\
  7. # apache2=2.4.*\
  8. # php-pear\
  9. # libapache2-mod-php7.0\
  10. # php7.0\
  11. # php7.0-gd\
  12. # php7.0-curl\
  13. # php7.0-pgsql\
  14. # php7.0-mcrypt\
  15. # php7.0-json &&\
  16. # apt-get clean
  17. #
  18. #COPY apache2.conf /etc/apache2/apache2.conf
  19. #COPY run.sh /run.sh
  20. #
  21. #RUN /usr/sbin/a2enmod rewrite &&\
  22. # ln -sf /dev/stdout /var/log/apache2/access.log &&\
  23. # ln -sf /dev/stderr /var/log/apache2/error.log &&\
  24. # rm -rf /var/www/ &&\
  25. # mkdir -p /var/lock/apache2 /var/run/apache2 /var/log/apache2 /var/www &&\
  26. # chown -R www-data:www-data /var/lock/apache2 /var/run/apache2 /var/log/apache2 /var/www &&\
  27. # chmod +x /run.sh
  28. #
  29. #EXPOSE 80
  30. #
  31. #VOLUME ["/var/www"]
  32. #
  33. #CMD ["/run.sh"]
  34. FROM debian:jessie
  35. MAINTAINER Robin Thoni <robin@rthoni.com>
  36. # persistent / runtime deps
  37. ENV PHPIZE_DEPS \
  38. autoconf \
  39. file \
  40. g++ \
  41. gcc \
  42. libc-dev \
  43. make \
  44. pkg-config \
  45. re2c
  46. RUN apt-get update && apt-get install -y \
  47. $PHPIZE_DEPS \
  48. ca-certificates \
  49. curl \
  50. libedit2 \
  51. libsqlite3-0 \
  52. libxml2 \
  53. --no-install-recommends && rm -r /var/lib/apt/lists/*
  54. ENV PHP_INI_DIR /usr/local/etc/php
  55. RUN mkdir -p $PHP_INI_DIR/conf.d
  56. ##<autogenerated>##
  57. RUN apt-get update && apt-get install -y apache2-bin apache2.2-common --no-install-recommends && rm -rf /var/lib/apt/lists/*
  58. RUN rm -rf /var/www/html && mkdir -p /var/lock/apache2 /var/run/apache2 /var/log/apache2 /var/www/html && chown -R www-data:www-data /var/lock/apache2 /var/run/apache2 /var/log/apache2 /var/www/html
  59. # Apache + PHP requires preforking Apache for best results
  60. RUN a2dismod mpm_event && a2enmod mpm_prefork
  61. RUN mv /etc/apache2/apache2.conf /etc/apache2/apache2.conf.dist && rm /etc/apache2/conf-enabled/* /etc/apache2/sites-enabled/*
  62. COPY apache2.conf /etc/apache2/apache2.conf
  63. # it'd be nice if we could not COPY apache2.conf until the end of the Dockerfile, but its contents are checked by PHP during compilation
  64. ENV PHP_EXTRA_BUILD_DEPS apache2-dev
  65. ENV PHP_EXTRA_CONFIGURE_ARGS --with-apxs2 --enable-maintainer-zts --enable-pthreads
  66. ##</autogenerated>##
  67. ENV GPG_KEYS 1A4E8B7277C42E53DBA9C7B9BCAA30EA9C0D5763
  68. ENV PHP_VERSION 7.0.7
  69. ENV PHP_FILENAME php-7.0.7.tar.xz
  70. ENV PHP_SHA256 9cc64a7459242c79c10e79d74feaf5bae3541f604966ceb600c3d2e8f5fe4794
  71. RUN set -xe \
  72. && buildDeps=" \
  73. $PHP_EXTRA_BUILD_DEPS \
  74. libcurl4-openssl-dev \
  75. libedit-dev \
  76. libsqlite3-dev \
  77. libssl-dev \
  78. libxml2-dev \
  79. xz-utils \
  80. " \
  81. && apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
  82. && curl -fSL "http://php.net/get/$PHP_FILENAME/from/this/mirror" -o "$PHP_FILENAME" \
  83. && echo "$PHP_SHA256 *$PHP_FILENAME" | sha256sum -c - \
  84. && curl -fSL "http://php.net/get/$PHP_FILENAME.asc/from/this/mirror" -o "$PHP_FILENAME.asc" \
  85. && export GNUPGHOME="$(mktemp -d)" \
  86. && for key in $GPG_KEYS; do \
  87. gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
  88. done \
  89. && gpg --batch --verify "$PHP_FILENAME.asc" "$PHP_FILENAME" \
  90. && rm -r "$GNUPGHOME" "$PHP_FILENAME.asc" \
  91. && mkdir -p /usr/src/php \
  92. && tar -xf "$PHP_FILENAME" -C /usr/src/php --strip-components=1 \
  93. && rm "$PHP_FILENAME" \
  94. && cd /usr/src/php \
  95. && ./configure \
  96. --with-config-file-path="$PHP_INI_DIR" \
  97. --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
  98. $PHP_EXTRA_CONFIGURE_ARGS \
  99. --disable-cgi \
  100. # --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself)
  101. --enable-mysqlnd \
  102. # --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195)
  103. --enable-mbstring \
  104. --with-curl \
  105. --with-libedit \
  106. --with-openssl \
  107. --with-zlib \
  108. && make -j"$(nproc)" \
  109. && make install \
  110. && { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \
  111. && make clean \
  112. && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false $buildDeps
  113. RUN ln -sf /dev/stdout /var/log/apache2/access.log \
  114. && ln -sf /dev/stderr /var/log/apache2/error.log \
  115. && ln -sf /dev/stdout /var/log/websocket.log \
  116. && ln -sf /dev/stderr /var/log/websocket.err \
  117. && a2enmod rewrite \
  118. && rm -rf /var/www/* \
  119. && chown -R www-data:www-data /var/www
  120. RUN curl https://getcomposer.org/composer.phar -o /usr/local/bin/composer && chmod +x /usr/local/bin/composer
  121. RUN apt-get update && apt-get install -y git unzip --no-install-recommends && rm -rf /var/lib/apt/lists/*
  122. COPY php-cli.ini /etc/php7.0/cli/php.ini
  123. RUN pecl install pthreads && mkdir -p /etc/php7.0/cli
  124. COPY run.sh /usr/local/bin/
  125. WORKDIR /var/www
  126. EXPOSE 8180
  127. EXPOSE 80
  128. VOLUME ["/var/www"]
  129. CMD ["run.sh"]