From 86b9e30e24e9d8a85ede7be9527ed7598a5bc923 Mon Sep 17 00:00:00 2001 From: 11notes Date: Mon, 15 Jan 2018 14:15:12 +0100 Subject: [PATCH] first config --- Dockerfile | 30 ++++++++++++++++++++++++++++++ nginx.conf | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 Dockerfile create mode 100644 nginx.conf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5e64162 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +# ------ Header ------ # +FROM alpine:latest +MAINTAINER 11notes + +# ------ download latest version of nginx and create folder structure, deleting default files ------ # + +# // update apk +RUN apk update \ +# // download and install nginx + && apk add nginx \ +# // create non-existing /run/nginx directory (PID) + && mkdir -p /run/nginx \ +# // create directory for SSL certificates (volume) + && mkdir -p /var/ssl \ +# // delete default vHost configuration + && rm /etc/nginx/conf.d/default.conf \ +# // delete default vHost web directory + && rm -R /var/www/localhost + +# // add default nginx.conf file +ADD ./nginx.conf /etc/nginx/nginx.conf + +# // default SIGTERM to docker +STOPSIGNAL SIGTERM + +# ------ define volumes ------ # +VOLUME ["/var/www", "/var/ssl", "/etc/nginx"] + +# ------ entrypoint for container ------ # +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..cd94a4a --- /dev/null +++ b/nginx.conf @@ -0,0 +1,43 @@ + # - Global Server Options - + + worker_processes 1; + worker_rlimit_nofile 204800; + pid /run/nginx/nginx.pid; + + # - Global Server Events - + events { + + worker_connections 4096; + use epoll; + multi_accept on; + + } + + # - HTTP Protocol Settings - + http { + + error_log /var/log/nginx/error.log crit; + access_log off; + server_tokens off; + + include mime.types; + default_type application/octet-stream; + + tcp_nopush on; + tcp_nodelay on; + gzip on; + + client_max_body_size 4M; + keepalive_timeout 15; + keepalive_requests 102400; + reset_timedout_connection on; + client_body_timeout 10; + send_timeout 5; + + open_file_cache max=204800 inactive=20s; + open_file_cache_valid 60s; + open_file_cache_min_uses 2; + open_file_cache_errors on; + + include /etc/nginx/conf.d/*.conf; + }