Bump Ruby to 2.6.6
[discourse_docker.git] / image / base / install-nginx
CommitLineData
e8b9677b
S
1#!/bin/bash
2set -e
e8b9677b 3
89620297 4# version check: https://nginx.org/en/download.html
8c7a9f14 5VERSION=1.17.9
89620297 6HASH="7dd65d405c753c41b7fdab9415cfb4bdbaf093ec6d9f7432072d52cb7bcbb689"
e8b9677b 7
89620297 8apt install -y autoconf
e8b9677b 9
89620297 10cd /tmp
e8b9677b
S
11git clone https://github.com/bagder/libbrotli
12cd libbrotli
13./autogen.sh
14./configure
15make install
16
17cd /tmp
e8b9677b 18curl -O https://nginx.org/download/nginx-$VERSION.tar.gz
89620297
MB
19sha256sum nginx-$VERSION.tar.gz
20echo "$HASH nginx-$VERSION.tar.gz" | sha256sum -c
e8b9677b
S
21tar zxf nginx-$VERSION.tar.gz
22cd nginx-$VERSION
23
70a33234
MB
24# nginx-common for boilerplate files etc.
25apt install -y nginx-common libpcre3 libpcre3-dev zlib1g zlib1g-dev
e8b9677b 26
89620297
MB
27cd /tmp
28# this is the reason we are compiling by hand...
29git clone https://github.com/google/ngx_brotli.git
1cd6aa50 30# now ngx_brotli has brotli as a submodule
89620297
MB
31cd /tmp/ngx_brotli
32git submodule update --init
f834837d 33
89620297 34cd /tmp/nginx-$VERSION
f834837d 35# ignoring depracations with -Wno-deprecated-declarations while we wait for this https://github.com/google/ngx_brotli/issues/39#issuecomment-254093378
f2eb9847 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
e8b9677b
S
37
38make install
e51e80ad
S
39
40mv /usr/share/nginx/sbin/nginx /usr/sbin
41
e8b9677b
S
42cd /
43rm -fr /tmp/nginx
44rm -fr /tmp/libbrotli
45rm -fr /tmp/ngx_brotli
416467f6 46rm -fr /etc/nginx/modules-enabled/*