|
| 1 | +FROM debian:jessie |
| 2 | + |
| 3 | +MAINTAINER Joeri Verdeyen <joeriv@yappa.be> |
| 4 | + |
| 5 | +ENV PHP_FPM_SOCKET "php:9000" |
| 6 | +ENV DOCUMENT_ROOT /var/www/app/web |
| 7 | +ENV INDEX_FILE app_dev.php |
| 8 | + |
| 9 | +ENV NPS_VERSION 1.9.32.10 |
| 10 | +ENV NGINX_VERSION 1.9.6 |
| 11 | +ENV OPENSSL_VERSION 1.0.2d |
| 12 | +ENV BUILDDIR /b |
| 13 | + |
| 14 | +RUN echo deb http://http.debian.net/debian jessie-backports main >> /etc/apt/sources.list && \ |
| 15 | + DEBIAN_FRONTEND=noninteractive apt-get update && \ |
| 16 | + apt-get -y install -t jessie-backports wget unzip build-essential zlib1g-dev libpcre3 libpcre3-dev && \ |
| 17 | + mkdir ${BUILDDIR} && cd ${BUILDDIR} && \ |
| 18 | + wget https://github.com/pagespeed/ngx_pagespeed/archive/release-${NPS_VERSION}-beta.zip && \ |
| 19 | + unzip release-${NPS_VERSION}-beta.zip && \ |
| 20 | + cd ngx_pagespeed-release-${NPS_VERSION}-beta/ && \ |
| 21 | + wget https://dl.google.com/dl/page-speed/psol/${NPS_VERSION}.tar.gz && \ |
| 22 | + tar -xzvf ${NPS_VERSION}.tar.gz && \ |
| 23 | + cd ${BUILDDIR} && \ |
| 24 | + wget http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \ |
| 25 | + tar -xvzf nginx-${NGINX_VERSION}.tar.gz && \ |
| 26 | + cd ${BUILDDIR} && \ |
| 27 | + wget http://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz && \ |
| 28 | + tar -xvzf openssl-${OPENSSL_VERSION}.tar.gz && \ |
| 29 | + cd ${BUILDDIR}/nginx-${NGINX_VERSION} && \ |
| 30 | + ./configure \ |
| 31 | + --add-module=${BUILDDIR}/ngx_pagespeed-release-${NPS_VERSION}-beta/ \ |
| 32 | + --with-openssl=${BUILDDIR}/openssl-${OPENSSL_VERSION} \ |
| 33 | + --prefix=/etc/nginx \ |
| 34 | + --sbin-path=/usr/sbin/nginx \ |
| 35 | + --conf-path=/etc/nginx/nginx.conf \ |
| 36 | + --error-log-path=/var/log/nginx/error.log \ |
| 37 | + --http-log-path=/var/log/nginx/access.log \ |
| 38 | + --pid-path=/var/run/nginx.pid \ |
| 39 | + --lock-path=/var/run/nginx.lock \ |
| 40 | + --with-http_ssl_module \ |
| 41 | + --with-http_realip_module \ |
| 42 | + --with-http_addition_module \ |
| 43 | + --with-http_sub_module \ |
| 44 | + --with-http_dav_module \ |
| 45 | + --with-http_flv_module \ |
| 46 | + --with-http_mp4_module \ |
| 47 | + --with-http_gunzip_module \ |
| 48 | + --with-http_gzip_static_module \ |
| 49 | + --with-http_random_index_module \ |
| 50 | + --with-http_secure_link_module \ |
| 51 | + --with-http_stub_status_module \ |
| 52 | + --with-mail \ |
| 53 | + --with-mail_ssl_module \ |
| 54 | + --with-file-aio \ |
| 55 | + --with-http_realip_module && \ |
| 56 | + make && make install && \ |
| 57 | + cd / && \ |
| 58 | + rm -r ${BUILDDIR} && \ |
| 59 | + apt-get purge -y --auto-remove wget build-essential unzip && \ |
| 60 | + rm -rf /var/lib/apt/lists/* && \ |
| 61 | + mkdir /ngx_pagespeed_cache && chmod -R 777 /ngx_pagespeed_cache && \ |
| 62 | + echo Europe/Brussels > /etc/timezone && \ |
| 63 | + dpkg-reconfigure --frontend noninteractive tzdata |
| 64 | + |
| 65 | +COPY nginx.conf /etc/nginx/ |
| 66 | +COPY default.conf /etc/nginx/sites-available/ |
| 67 | + |
| 68 | +RUN mkdir -p /etc/nginx/sites-enabled && \ |
| 69 | + mkdir -p /etc/nginx/conf.d/ && \ |
| 70 | + touch /etc/nginx/conf.d/upstream.conf && \ |
| 71 | + ln -sf /etc/nginx/sites-available/default.conf /etc/nginx/sites-enabled/default && \ |
| 72 | + usermod -u 1000 www-data && \ |
| 73 | + ln -sf /dev/stderr /var/log/nginx/error.log |
| 74 | + |
| 75 | +EXPOSE 80 |
| 76 | +EXPOSE 443 |
| 77 | + |
| 78 | +COPY run.sh /run.sh |
| 79 | + |
| 80 | +RUN chmod +x /run.sh |
| 81 | + |
| 82 | +CMD ["/run.sh"] |
0 commit comments