afbf43da by Adam Heath

Importing into a fresh repository.

1 parent fa5376f9
nginx.tar.gz
FROM docker.brainfood.com/dumb-init
RUN ["apt-docker", \
"-y", "install", "libgeoip1", "libxslt1.1", "libgd3", "ca-certificates", \
";" ]
ADD nginx.tar.gz /usr/local
ADD /overlay/ /
EXPOSE 80 443
ENTRYPOINT ["/usr/bin/dumb-init", "/usr/local/nginx/sbin/nginx", "-g", "daemon off;"]
nginx.tar.gz
ngx_pagespeed.zip
psol.tar.gz
git-bundles/*.bundle
FROM docker.brainfood.com/debian-support
RUN ["apt-docker", \
"-y", "install", \
"wget", \
"build-essential", \
"zlib1g-dev", "libpcre3-dev", "libssl-dev", "libxslt1-dev", "libgd-dev", "libgeoip-dev", \
"zip", "unzip",\
"git", \
";" ]
ENV \
NPS_VERSION=1.12.34.2-beta \
NGINX_VERSION=1.11.7
#ADD nginx.tar.gz ngx_pagespeed.zip psol.tar.gz /tmp/build/
ADD nginx.tar.gz /tmp/build/
WORKDIR /tmp/build
ADD ngx_pagespeed.zip /tmp/build/
ADD git-bundles/* /tmp/build/git-bundles/
RUN unzip ngx_pagespeed.zip
ADD psol.tar.gz /tmp/build/ngx_pagespeed-${NPS_VERSION}/
ADD /overlay/ /
RUN /tmp/build/build-in-docker.sh
#!/bin/sh
set -e
volume="$1"
shift
docker-git-bundle https://github.com/yaoweibin/ngx_http_substitutions_filter_module.git "$volume/git-bundles/ngx_http_substitutions_filter_module.bundle"
docker-download-file http://nginx.org/download/nginx-1.11.7.tar.gz "$volume/nginx.tar.gz"
docker-download-file http://dl.google.com/dl/page-speed/psol/1.12.34.2-x64.tar.gz "$volume/psol.tar.gz"
docker-download-file https://github.com/pagespeed/ngx_pagespeed/archive/v1.12.34.2-beta.zip "$volume/ngx_pagespeed.zip"
#!/bin/bash
NPS_VERSION=1.12.34.2-beta
NGINX_VERSION=1.11.7
set -e
#cd /tmp/build
# -- nginx
# extraction handled by docker-build
# tar -xvzf nginx.tar.gz
declare -a nginx_modules=(
"--add-module=/tmp/build/ngx_pagespeed-${NPS_VERSION}"
)
# -- ngx_http_substitutions_filter
for bundle in git-bundles/*; do
git clone "$bundle"
configure_module_options+=("--add-module=/tmp/build/${bundle%.*}")
done
# -- ngx_pagespeed
#unzip ngx_pagespeed.zip
#psol_url=https://dl.google.com/dl/page-speed/psol/${NPS_VERSION}.tar.gz
#[ -e scripts/format_binary_url.sh ] && psol_url=$(scripts/format_binary_url.sh PSOL_BINARY_URL)
#psol_url=${psol_url/https:}
#psol_url=${psol_url/http:}
#psol_url=http:$psol_url
# extraction handled by docker-build
# tar -xzvf /tmp/build/psol.tar.gz # extracts to psol/
#mv /tmp/build/psol /tmp/build/ngx_pagespeed-${NPS_VERSION}
cd nginx-${NGINX_VERSION}/
declare -a nginx_configure_options=(
--with-debug
--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_geoip_module
--with-http_gzip_static_module
--with-http_image_filter_module
# --with-http_spdy_module
--with-http_sub_module
--with-http_xslt_module
--with-mail
--with-mail_ssl_module
# --add-module=/build/nginx-D0f8kM/nginx-1.6.2/debian/modules/nginx-auth-pam
# --add-module=/build/nginx-D0f8kM/nginx-1.6.2/debian/modules/nginx-dav-ext-module
# --add-module=/build/nginx-D0f8kM/nginx-1.6.2/debian/modules/nginx-echo
# --add-module=/build/nginx-D0f8kM/nginx-1.6.2/debian/modules/nginx-upstream-fair
# --add-module=/build/nginx-D0f8kM/nginx-1.6.2/debian/modules/ngx_http_substitutions_filter_module
)
./configure \
"${nginx_configure_options[@]}" \
"${nginx_modules[@]}" \
${PS_NGX_EXTRA_FLAGS}
make -j4
make install
mkdir -p /tmp/build-output
tar -C /usr/local -vc nginx | gzip -9v > /tmp/build-output/nginx.tar.gz
rm -rf /usr/local/nginx
rm -rf /tmp/build
version: '2'
services:
build:
image: docker.brainfood.com/nginx-pagespeed
build:
context: .
args:
- http_proxy
- https_proxy
compile:
build:
context: compile/nginx-pagespeed
args:
- http_proxy
- https_proxy
volumes:
- .:/tmp/nginx-pagespeed
command: ["cp", "-av", "/tmp/build-output/nginx.tar.gz", "/tmp/nginx-pagespeed/nginx.tar.gz"]
download:
image: docker.brainfood.com/debian-support
environment:
- http_proxy
- https_proxy
volumes:
- ./compile/nginx-pagespeed/:/tmp/nginx-pagespeed/
command: ["/tmp/nginx-pagespeed/download-files", "/tmp/nginx-pagespeed"]
#user nobody;
worker_processes 7;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
include /usr/local/nginx/conf.d/*.conf;
}