Sign inSign up

unveu82/nginx-clojure

By unveu82

•Updated about 10 years ago

Nginx with nginx-clojure, GeoIP2 and Java 8

Image
2

10K+

unveu82/nginx-clojure repository overview

Compromise between production readiness (ubuntu 16.04 LTS) and small file size. GeoLite2-City is used for geo resolution. SSL support is compiled, but not configured.

⁠Changelog

2016-09-14: Made en-US-UTF-8 locale the default

⁠Usage:

Mount your site configuration into /usr/local/nginx/sites-enabled/. If you plan to use a java application instead of inline code with no dependencies, don't forget to mount your application into /usr/local/nginx/html/ (that is where the classpath is pointing to)

docker run -d -t -i -p 80:80 -v /webapp:/usr/local/nginx/html/ -v /your-sites-enabled:/usr/local/nginx/sites-enabled unveu82/nginx-clojure
⁠Nginx

Nginx has been compiled using the following flags:

root@08b3908644a4:/# nginx -V
nginx version: nginx/1.10.1
built by gcc 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.2) 
built with OpenSSL 1.0.2g-fips  1 Mar 2016
TLS SNI support enabled
configure arguments: --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_gzip_static_module --without-http_browser_module --without-http_geo_module --without-http_memcached_module --without-http_referer_module --without-http_scgi_module --without-http_split_clients_module --without-http_ssi_module --without-http_userid_module --without-http_uwsgi_module --add-module=/nginx-clojure-0.4.4/src/c --add-module=/ngx_http_geoip2_module-1.1/
⁠Java
root@08b3908644a4:/# java -version
openjdk version "1.8.0_91"
OpenJDK Runtime Environment (build 1.8.0_91-8u91-b14-3ubuntu1~16.04.1-b14)
OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)
⁠Dockerfile
FROM ubuntu:16.04
MAINTAINER Johannes W. Kunze <[email protected]>

LABEL Description="Nginx with: \
                   nginx-1.10.1 \
                   nginx-clojure-0.4.4 \
                   openjdk-8-jre-headless \
                   libmaxminddb-1.2.0 \
                   ngx_http_geoip2_module-1.1" \
      Vendor="GfK SE" \
      Version="1.0.0"


COPY ["nginx-1.10.1.tar.gz","/tmp"]
COPY ["nginx-clojure-0.4.4.tar.gz","/tmp"]
COPY ["pcre-8.39.tar.gz","/tmp"]
COPY ["zlib-1.2.8.tar.gz","/tmp"]
COPY ["ngx_http_geoip2_module-1.1.tar.gz","/tmp"]
COPY ["libmaxminddb-1.2.0.tar.gz","/tmp"]

RUN apt-get update && \ 
    apt-get install -y \
       build-essential \
       libssl-dev \
       openjdk-8-jdk && \
    tar xfz /tmp/nginx-1.10.1.tar.gz && \
    tar xfz /tmp/nginx-clojure-0.4.4.tar.gz && \
    tar xfz /tmp/pcre-8.39.tar.gz && \
    tar xfz /tmp/zlib-1.2.8.tar.gz && \
    tar xfz /tmp/libmaxminddb-1.2.0.tar.gz && \
    tar xfz /tmp/ngx_http_geoip2_module-1.1.tar.gz && \    
    cd /pcre-8.39/ && \ 
        ./configure && \
        make && \
        make install && \
    cd /zlib-1.2.8/ && \
        ./configure && \
        make && \
        make install && \
    cd /libmaxminddb-1.2.0/ && \
        ./configure && \
        make && \
        make install && \
    cd /nginx-1.10.1/ && \
	./configure \
            --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_gzip_static_module \
            --without-http_browser_module \
            --without-http_geo_module \
            --without-http_memcached_module \
            --without-http_referer_module \
            --without-http_scgi_module \
            --without-http_split_clients_module \
            --without-http_ssi_module \
            --without-http_userid_module \
            --without-http_uwsgi_module \
            --add-module=/nginx-clojure-0.4.4/src/c \
            --add-module=/ngx_http_geoip2_module-1.1/ && \
	make && \
	make install && \
    rm -rf /nginx-1.10.1 \
        /nginx-clojure-0.4.4 \
        /pcre-8.39 \
        /ngx_http_geoip2_module-1.1 \
        /libmaxminddb-1.2.0 \
        /zlib-1.2.8 && \
    apt-get remove --purge -y \
        build-essential \
        $(apt-mark showauto) && \
    apt-get -y autoremove && \
    apt-get install -y \
        openjdk-8-jre-headless && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* && \
    rm -rf /tmp/*.tar.gz 

RUN locale-gen en_US.UTF-8

ENV JAVA_HOME /usr/lib/jvm/java-1.8.0-openjdk-amd64/
ENV PATH $PATH:/usr/local/nginx/sbin/
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8

COPY ["conf/","/usr/local/nginx/conf/"]
RUN mkdir /usr/local/nginx/sites-enabled

EXPOSE 80 443

CMD [ "nginx" ]

Tag summary

Content type

Image

Digest

Size

137 MB

Last updated

about 10 years ago

docker pull unveu82/nginx-clojure