From 8019cd72402e8f4e4d4437bb7dddb3e58fad675d Mon Sep 17 00:00:00 2001 From: Berger Adrian Date: Fri, 1 Apr 2022 10:38:31 +0200 Subject: [PATCH] Run container unprivileged --- Dockerfile | 6 +++--- README.md | 4 ++-- default.conf | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 891a7e4..65f9945 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -FROM nginx:alpine +FROM nginxinc/nginx-unprivileged:stable-alpine -MAINTAINER Mohammad Naghavi +LABEL author="Mohammad Naghavi " ADD default.conf /etc/nginx/conf.d/default.conf ADD css/ /opt/www/file-browser/css/ @@ -9,4 +9,4 @@ 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 +EXPOSE 8080 \ No newline at end of file diff --git a/README.md b/README.md index 9d9bb68..c0ecd1c 100644 --- a/README.md +++ b/README.md @@ -12,11 +12,11 @@ A sample nginx configuration is also included which mounts **file browser** unde Mainly for demonstration purposes a docker image is also available [here](https://hub.docker.com/r/mohamnag/nginx-file-browser/). In order to use this docker image, the volume which has to be served should -be mounted under `/opt/www/files/` and port `80` of container shall be mapped +be mounted under `/opt/www/files/` and port `8080` of container shall be mapped to a proper port on host. A proper run would look like: ``` -$ docker run -p 8080:80 -v /path/to/my/files/:/opt/www/files/ mohamnag/nginx-file-browser +$ docker run -p 8080:8080 -v /path/to/my/files/:/opt/www/files/ mohamnag/nginx-file-browser ``` With container up and running you can point your browser to IP of docker host with given port to view the files. For example with above run command assuming docker host having IP with `192.168.0.200` we have to navigate to this URL: diff --git a/default.conf b/default.conf index 3efc137..6600917 100644 --- a/default.conf +++ b/default.conf @@ -1,5 +1,5 @@ server { - listen 80; + listen 8080; server_name localhost; root /opt/www/;