downgrade ruby to 2.3.4
[discourse_docker.git] / image / base / install-nginx
CommitLineData
e8b9677b
S
1#!/bin/bash
2set -e
2de1048e 3VERSION=1.12.1
e8b9677b
S
4cd /tmp
5
6apt-get install -y autoconf
7
8
9git clone https://github.com/bagder/libbrotli
10cd libbrotli
11./autogen.sh
12./configure
13make install
14
15cd /tmp
16
17
18# this is the reason we are compiling by hand...
19git clone https://github.com/google/ngx_brotli.git
20
21curl -O https://nginx.org/download/nginx-$VERSION.tar.gz
22tar zxf nginx-$VERSION.tar.gz
23cd nginx-$VERSION
24
25# so we get nginx user and so on
26apt-get install -y nginx libpcre3 libpcre3-dev
27# we don't want to accidentally upgrade nginx and undo our work
28apt-mark hold nginx
29
1cd6aa50
RSS
30# now ngx_brotli has brotli as a submodule
31cd /tmp/ngx_brotli && git submodule update --init && cd /tmp/nginx-$VERSION
f834837d
RSS
32
33# ignoring depracations with -Wno-deprecated-declarations while we wait for this https://github.com/google/ngx_brotli/issues/39#issuecomment-254093378
f2eb9847 34./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
35
36make install
e51e80ad
S
37
38mv /usr/share/nginx/sbin/nginx /usr/sbin
39
e8b9677b
S
40cd /
41rm -fr /tmp/nginx
42rm -fr /tmp/libbrotli
43rm -fr /tmp/ngx_brotli