Giter VIP home page Giter VIP logo

docker-nut-cgi's Introduction

docker-nut-cgi

A container with the CGI tools of Network UPS Tools and fcgiwrap to be used in conjunction with an nginx container.

Many nginx containers are based on alpine which does not have the Nut CGI tools available. This container is based on Ubuntu and installs nut-cgi and fcgiwrap.

Usage

docker-compose

Compatible with docker-compose v3 schemas.

---
version: "3"
services:
  nut-cgi:
    image: jchonig/nut-cgi
    container_name: nut-cgi
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
    volumes:
	  - nut-html:/config/www/nut
      - /etc/nut/hosts.conf:/etc/nut/hosts.conf:ro
	expose:
	  - 8081
    restart: unless-stopped

   nginx:
     ...
   volumes:
     ...
	 - nut-html:/config/www/nut:ro
   restart: unless-stopped
   depends_on: nut-cgi

volumes:
  nut-html:

Parameters

Environment Variables (-e)

Env Function
PUID=1000 for UserID - Set to UID that will run Nginx
PGID=1000 for GroupID - Set to GID that will run Nginx
TZ=UTC Specify a timezone to use EG UTC

Volume Mappings (-v)

Volume Function
/config/www/nut This private volume receives a copy of /usr/share/nut/www to be used by nginx

Application Setup

  • Map a NUT hosts.conf file to /etc/nut/hosts.conf
  • Configure nginx to talk to the nut-cgi container for cgi-bin/nut:
    location /nut {
		root /config/www;
		try_files $uri/index.html =404;
        }
	location /cgi-bin/nut/ {
		gzip off;
		root /usr/lib;

		include /etc/nginx/fastcgi_params;
		fastcgi_pass nut-cgi:8081;
		fastcgi_param SCRIPT_FILENAME /usr/lib/$fastcgi_script_name;
	}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.