From 07528ab95757d3c488eb07ed66b0d71ef153013a Mon Sep 17 00:00:00 2001 From: Mohammad Naghavi Date: Thu, 11 Feb 2016 22:17:49 +0100 Subject: [PATCH] adding sample docker file and nginx config --- Dockerfile | 12 ++++++++++++ default.conf | 28 ++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 Dockerfile create mode 100644 default.conf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9b6edd0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM nginx + +MAINTAINER Mohammad Naghavi + +ADD default.conf /etc/nginx/conf.d/default.conf +ADD css/ /opt/www/file-browser/css/ +ADD image/ /opt/www/file-browser/image/ +ADD js/ /opt/www/file-browser/js/ +ADD index.html /opt/www/file-browser/ + +VOLUME /opt/www/files/ +EXPOSE 80 \ No newline at end of file diff --git a/default.conf b/default.conf new file mode 100644 index 0000000..ceb05da --- /dev/null +++ b/default.conf @@ -0,0 +1,28 @@ +server { + listen 80; + server_name localhost; + + root /opt/www/; + index index.html index.htm; + + location ~* (/javadoc)|(/tests) { + autoindex off; + } + + location /files/ { + root /opt/www/; # will at the end serve /opt/www/files/ + autoindex on; + autoindex_format json; + disable_symlinks off; + } + + location / { + root /opt/www/file-browser/; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + +} \ No newline at end of file