Bump Ruby to 2.6.6
[discourse_docker.git] / image / base / install-nginx
... / ...
CommitLineData
1#!/bin/bash
2set -e
3
4# version check: https://nginx.org/en/download.html
5VERSION=1.17.9
6HASH="7dd65d405c753c41b7fdab9415cfb4bdbaf093ec6d9f7432072d52cb7bcbb689"
7
8apt install -y autoconf
9
10cd /tmp
11git clone https://github.com/bagder/libbrotli
12cd libbrotli
13./autogen.sh
14./configure
15make install
16
17cd /tmp
18curl -O https://nginx.org/download/nginx-$VERSION.tar.gz
19sha256sum nginx-$VERSION.tar.gz
20echo "$HASH nginx-$VERSION.tar.gz" | sha256sum -c
21tar zxf nginx-$VERSION.tar.gz
22cd nginx-$VERSION
23
24# nginx-common for boilerplate files etc.
25apt install -y nginx-common libpcre3 libpcre3-dev zlib1g zlib1g-dev
26
27cd /tmp
28# this is the reason we are compiling by hand...
29git clone https://github.com/google/ngx_brotli.git
30# now ngx_brotli has brotli as a submodule
31cd /tmp/ngx_brotli
32git submodule update --init
33
34cd /tmp/nginx-$VERSION
35# ignoring depracations with -Wno-deprecated-declarations while we wait for this https://github.com/google/ngx_brotli/issues/39#issuecomment-254093378
36./configure --with-cc-opt='-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wno-deprecated-declarations' --with-ld-opt='-Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_addition_module --with-http_dav_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_v2_module --with-http_sub_module --with-stream --with-stream_ssl_module --with-mail --with-mail_ssl_module --with-threads --add-module=/tmp/ngx_brotli
37
38make install
39
40mv /usr/share/nginx/sbin/nginx /usr/sbin
41
42cd /
43rm -fr /tmp/nginx
44rm -fr /tmp/libbrotli
45rm -fr /tmp/ngx_brotli
46rm -fr /etc/nginx/modules-enabled/*