diff options
Diffstat (limited to 'samples/services/nginx/docker/subservices/server/Dockerfile')
-rw-r--r-- | samples/services/nginx/docker/subservices/server/Dockerfile | 102 |
1 files changed, 97 insertions, 5 deletions
diff --git a/samples/services/nginx/docker/subservices/server/Dockerfile b/samples/services/nginx/docker/subservices/server/Dockerfile index 434a8d4..1ab0481 100644 --- a/samples/services/nginx/docker/subservices/server/Dockerfile +++ b/samples/services/nginx/docker/subservices/server/Dockerfile @@ -15,14 +15,106 @@ RUN \ wget \ libdnet \ net-tools \ -# Nginx as proxy - nginx \ +# Packages required to build nginx from source + build-essential \ + libpcre3-dev \ + libpcre3++-dev \ + libgeoip-dev \ + libxslt-dev \ + git \ +# Install required python packages python-pip \ && \ -# Install required python packages - python -m pip install grpcio redis jinja2 protobuf + python -m pip install grpcio redis jinja2 protobuf psutil \ +&& \ +# Get nginx and module add-on source + wget https://nginx.org/download/nginx-1.15.0.tar.gz && tar zxvf nginx-1.15.0.tar.gz \ +&& \ + wget https://ftp.pcre.org/pub/pcre/pcre-8.42.tar.gz && tar xzvf pcre-8.42.tar.gz \ +&& \ + wget http://www.zlib.net/zlib-1.2.11.tar.gz && tar xzvf zlib-1.2.11.tar.gz \ +&& \ + wget https://www.openssl.org/source/openssl-1.1.0f.tar.gz && tar xzvf openssl-1.1.0f.tar.gz \ +&& \ + git clone https://github.com/Austinb/nginx-upload-module.git \ +&& \ + wget https://github.com/arut/nginx-rtmp-module/archive/v1.2.1.tar.gz && tar xzvf v1.2.1.tar.gz +RUN rm -rf *.tar.gz + +# Build supporting modules +ENV LDFLAGS -fPIC +WORKDIR /pcre-8.42 +RUN ./configure +RUN make +RUN make install + +WORKDIR /zlib-1.2.11 +RUN ./configure +RUN make +RUN make install + +WORKDIR /openssl-1.1.0f +RUN ./config +RUN make +RUN make install + +WORKDIR /nginx-1.15.0 + +# Build nginx with all modules in stock Ubuntu 16.04 version +# Add upload and rtmp modules +RUN ./configure \ + --prefix=/usr/share/nginx \ + --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \ + --http-scgi-temp-path=/var/lib/nginx/scgi \ + --sbin-path=/usr/sbin/nginx \ + --conf-path=/etc/nginx/nginx.conf \ + --error-log-path=/var/log/nginx/error.log \ + --http-log-path=/var/log/nginx/access.log \ + --pid-path=/run/nginx.pid \ + --lock-path=/var/lock/nginx.lock \ + --with-pcre=../pcre-8.42 \ + --with-pcre-jit \ + --with-ipv6 \ + --with-http_stub_status_module \ + # --with-http_image_filter_module \ + --with-http_xslt_module \ + --with-mail \ + --with-zlib=../zlib-1.2.11 \ + --with-openssl=../openssl-1.1.0f \ + --with-openssl-opt=enable-ec_nistp_64_gcc_128 \ + --with-openssl-opt=no-nextprotoneg \ + --with-openssl-opt=no-weak-ssl-ciphers \ + --with-openssl-opt=no-ssl3 \ + --with-http_ssl_module \ + --with-stream \ + --with-stream_ssl_module \ + --with-threads \ + --with-mail=dynamic \ + --with-mail_ssl_module \ + --http-client-body-temp-path=/var/lib/nginx/body \ + --http-proxy-temp-path=/var/lib/nginx/proxy \ + --with-http_realip_module \ + --with-http_geoip_module \ + --http-uwsgi-temp-path=/var/lib/nginx/uwsgi \ + --with-http_v2_module \ + --with-http_sub_module \ + --with-http_addition_module \ + --with-http_dav_module \ + --with-http_auth_request_module \ + --with-http_gunzip_module \ + --with-http_gzip_static_module \ + --with-debug \ + --add-module=../nginx-upload-module \ + --add-module=../nginx-rtmp-module-1.2.1 + +RUN make +RUN make install + +WORKDIR / +RUN mkdir /var/lib/nginx +RUN mkdir /var/www +RUN mkdir /var/www/html COPY /process /process COPY /grpc /grpc CMD ./process/start_process.sh server - |