Skip to content

Commit

Permalink
Merge pull request #1 from anton-kasperovich/image_improvements
Browse files Browse the repository at this point in the history
Official Alpine and adjust NGINX settings
  • Loading branch information
nickdgriffin committed May 20, 2016
2 parents c944401 + 1993e6a commit 34d3f04
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 36 deletions.
28 changes: 12 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
FROM gliderlabs/alpine:3.3
FROM alpine:3.3

RUN apk-install alpine-sdk \
RUN apk --update add \
openssl-dev \
pcre-dev \
openssl-dev
zlib-dev \
git \
wget \
build-base && \
rm -rf /var/cache/apk/*

ENV nginx_home /var/tmp/nginx

# Lets do some best practises writing dockefile. :D
ENV RUN_USER proxy
ENV RUN_GROUP proxy
ENV RUN_USER proxy
ENV RUN_GROUP proxy

RUN adduser -u 1001 -S ${RUN_USER} && addgroup -S ${RUN_GROUP}

RUN mkdir -p ${nginx_home}

ENV nginx_version 1.9.7
ENV header_module_version 0.29

WORKDIR ${nginx_home}


#TODO need to remove the git clone lines and get from everything else from a trusted source.

RUN wget http://nginx.org/download/nginx-${nginx_version}.tar.gz \
&& git clone https://github.com/nginx-shib/nginx-http-shibboleth.git \
&& wget https://github.com/openresty/headers-more-nginx-module/archive/v${header_module_version}.tar.gz
Expand All @@ -39,11 +39,11 @@ RUN tar zxvf v${header_module_version}.tar.gz \

# Lets clean up
RUN rm -rf ${nginx_home} \
&& apk del alpine-sdk
&& apk del git build-base

RUN mkdir -p /usr/local/nginx/ \
&& mkdir -p /usr/local/nginx/sites-enabled/ \
&& mkdir -p /usr/local/nginx/includes.d
&& mkdir -p /usr/local/nginx/includes.d

ADD servers/sites-enabled /usr/local/nginx/sites-enabled/
ADD servers/conf /usr/local/nginx/conf/
Expand All @@ -52,12 +52,8 @@ RUN chmod -R 700 /usr/local/nginx/ \
&& chown -R ${RUN_USER}:${RUN_GROUP} /usr/local/nginx/ \
&& rm -f /usr/local/nginx/conf/nginx.conf.default


EXPOSE 80 443

WORKDIR /usr/local/nginx

CMD ["/usr/local/nginx/sbin/nginx", "-g", "daemon off;"]



39 changes: 19 additions & 20 deletions servers/conf/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
user proxy;
worker_processes 1;

error_log /dev/stderr;

#pid /usr/local/nginx/run/nginx.pid;


worker_processes 4;

error_log /dev/stderr warn;

events {
worker_connections 1024;
worker_connections 1024;
}



http {
access_log /dev/stdout;


sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
server_tokens off;
server_name_in_redirect off;

include mime.types;
default_type application/octet-stream;

sendfile on;

keepalive_timeout 65;


access_log off;

include /usr/local/nginx/sites-enabled/*;

client_max_body_size 1024m;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 16k;
fastcgi_buffer_size 16k;
}

0 comments on commit 34d3f04

Please sign in to comment.