Add 2 image variants (root & rootless)
This commit is contained in:
parent
8019cd7240
commit
6e7c4e274a
5 changed files with 47 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
|||
FROM nginxinc/nginx-unprivileged:stable-alpine
|
||||
FROM nginx:alpine
|
||||
|
||||
LABEL author="Mohammad Naghavi <mohamnag@gmail.com>"
|
||||
|
||||
|
@ -9,4 +9,4 @@ ADD js/ /opt/www/file-browser/js/
|
|||
ADD index.html /opt/www/file-browser/
|
||||
|
||||
VOLUME /opt/www/files/
|
||||
EXPOSE 8080
|
||||
EXPOSE 80
|
12
Dockerfile-rootless
Normal file
12
Dockerfile-rootless
Normal file
|
@ -0,0 +1,12 @@
|
|||
FROM nginxinc/nginx-unprivileged:stable-alpine
|
||||
|
||||
LABEL author="Mohammad Naghavi <mohamnag@gmail.com>"
|
||||
|
||||
ADD default-rootless.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 8080
|
|
@ -12,9 +12,14 @@ 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 `8080` of container shall be mapped
|
||||
be mounted under `/opt/www/files/` and port `80` (root) or `8080` (rootless)) of container shall be mapped
|
||||
to a proper port on host. A proper run would look like:
|
||||
|
||||
root
|
||||
```
|
||||
$ docker run -p 8080:80 -v /path/to/my/files/:/opt/www/files/ mohamnag/nginx-file-browser
|
||||
```
|
||||
rootless:
|
||||
```
|
||||
$ docker run -p 8080:8080 -v /path/to/my/files/:/opt/www/files/ mohamnag/nginx-file-browser
|
||||
```
|
||||
|
|
26
default-rootless.conf
Normal file
26
default-rootless.conf
Normal file
|
@ -0,0 +1,26 @@
|
|||
server {
|
||||
listen 8080;
|
||||
server_name localhost;
|
||||
|
||||
root /opt/www/;
|
||||
index index.html index.htm;
|
||||
|
||||
location /files/ {
|
||||
alias /opt/www/files/;
|
||||
index ___i; # we really need no index here, just listing 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;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
server {
|
||||
listen 8080;
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
root /opt/www/;
|
||||
|
|
Loading…
Reference in a new issue