diff --git a/.docker/nginx-vhost.conf b/.docker/nginx-vhost.conf new file mode 100644 index 0000000000000000000000000000000000000000..4471349ad60f0cba9fbf90f13d4833dabda85027 --- /dev/null +++ b/.docker/nginx-vhost.conf @@ -0,0 +1,20 @@ +server { + listen 80; + server_name localhost; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + } + + location ~ /\.docker { + deny all; + } + + location /images { + alias /images; + autoindex on; + } +} + + diff --git a/.gitignore b/.gitignore index c321e7911555d4f27bf6642adb559eb56a654723..775b13f2bd8e30cffd416e71bd0672d410d00988 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ +*.swp config.js images/* diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..b16ab61ceaf14d48d2b8e289eb5a3f490d7a5a04 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM nginx:alpine + +COPY . /usr/share/nginx/html/ +COPY .docker/nginx-vhost.conf /etc/nginx/conf.d/default.conf + +HEALTHCHECK --interval=1m --timeout=10s \ + CMD nc -z localhost 80 + +VOLUME ["/images"] diff --git a/README.md b/README.md index 5bd08582f3583370378d3d1079caf3e6b47e4f64..764d01c5916d11ff4b6d34caaf83eed1da1b3348 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,14 @@ location /path/to/builds/ { #### Python Webserver For testing purposes or to share files in a LAN, Python can be used. Run `python -m http.server 8080` from within this directory (the directory where `README.md` can be found) and you are done. +#### Docker +``` +docker build -t gluon-firmware-selector . +docker run -p 80:80 -v /path/to/firmware/:/images:ro -v /path/to/config.js:/usr/share/nginx/html/config.js:ro --name web_firmware gluon-firmware-selector +``` +For https support check [jrcs/letsencrypt-nginx-proxy-companion](https://hub.docker.com/r/jrcs/letsencrypt-nginx-proxy-companion) + + ### List of available router models All available router models are specified in `devices.js` via that will match against the filenames. If no hardware revision is given or is it is empty, the revision is extracted from the file name.