diff --git a/Dockerfile b/Dockerfile index 5691ec6..f812576 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,18 @@ -FROM nginx:1.9.12 +FROM nginx:alpine MAINTAINER Jason Wilder mail@jasonwilder.com # Install wget and install/updates certificates -RUN apt-get update \ - && apt-get install -y -q --no-install-recommends \ +RUN apk add --no-cache --virtual .run-deps \ ca-certificates \ - wget \ - && apt-get clean \ - && rm -r /var/lib/apt/lists/* + bash # Configure Nginx and apply fix for very long server names -RUN echo "daemon off;" >> /etc/nginx/nginx.conf \ - && sed -i 's/^http {/&\n server_names_hash_bucket_size 128;/g' /etc/nginx/nginx.conf +COPY nginx.conf /etc/nginx/ +RUN mkdir /etc/nginx/conf.d # Install Forego -ADD https://github.com/jwilder/forego/releases/download/v0.16.1/forego /usr/local/bin/forego -RUN chmod u+x /usr/local/bin/forego - +RUN wget https://github.com/jwilder/forego/releases/download/v0.16.1/forego -O /usr/local/bin/forego \ + && chmod u+x /usr/local/bin/forego ENV DOCKER_GEN_VERSION 0.7.0 RUN wget https://github.com/jwilder/docker-gen/releases/download/$DOCKER_GEN_VERSION/docker-gen-linux-amd64-$DOCKER_GEN_VERSION.tar.gz \ diff --git a/Makefile b/Makefile index 213a441..91e8987 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ update-dependencies: docker pull jwilder/docker-gen:0.7.0 - docker pull nginx:1.9.12 + docker pull nginx:alpine docker pull python:3 docker pull rancher/socat-docker:latest docker pull appropriate/curl:latest diff --git a/README.md b/README.md index d277421..98f782a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![nginx 1.9.12](https://img.shields.io/badge/nginx-1.9.12-brightgreen.svg) ![License MIT](https://img.shields.io/badge/license-MIT-blue.svg) [![Build](https://circleci.com/gh/jwilder/nginx-proxy.svg?&style=shield&circle-token=2da3ee844076a47371bd45da81cf27409ca7306a)](https://circleci.com/gh/jwilder/nginx-proxy) [![Build Status](https://travis-ci.org/jwilder/nginx-proxy.svg?branch=master)](https://travis-ci.org/jwilder/nginx-proxy) +![nginx alpine](https://img.shields.io/badge/nginx-alpine-brightgreen.svg) ![License MIT](https://img.shields.io/badge/license-MIT-blue.svg) [![Build](https://circleci.com/gh/jwilder/nginx-proxy.svg?&style=shield&circle-token=2da3ee844076a47371bd45da81cf27409ca7306a)](https://circleci.com/gh/jwilder/nginx-proxy) [![Build Status](https://travis-ci.org/jwilder/nginx-proxy.svg?branch=master)](https://travis-ci.org/jwilder/nginx-proxy) nginx-proxy sets up a container running nginx and [docker-gen][1]. docker-gen generates reverse proxy configs for nginx and reloads nginx when containers are started and stopped. diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..f16c604 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,40 @@ + +daemon off; + +#user nobody; +worker_processes 1; + +#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 { + server_names_hash_bucket_size 128; + + 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; + + include conf.d/*.conf; +}