Code Monkey home page Code Monkey logo

dockwatch's Introduction

Logo

Dockwatch

Purpose

Simple UI driven way to manage updates & notifications for containers. This is meant to be simple, so there is no db required. All settings and files are stored in the /config mount instead.

Notification triggers

  • Notify when a container is added
  • Notify when a container is removed
  • Notify when a container changes state (running -> stopped)
  • Notify when a container is unhealthy
  • Notify when an update is available
  • Notify when an update is applied
  • Notify when images are pruned
  • Notify when volumes are pruned
  • Notify if memory is > n%
  • Notify if CPU is > n%

Notification platforms

  • Notifiarr

Update options

  • Ignore
  • Auto update
  • Check for updates

Some features

  • Link and control multiple servers
  • Try to find/match icons for non unraid usage
  • Setup update schedules on a container by container basis
  • Setup notify only or update on a container by container basis
  • Automatically try to restart unhealthy containers
  • Mass prune/remove orphan images and volumes
  • Add container groups for easier management
  • Mass select containers and generate docker run commands
  • Mass select containers and generate a docker-compose for them
  • Mass select containers and do a mount compare for them
  • Mass select containers and start/restart/stop/pull/update

Network dependencies

If you have containers that depend on other container networks (Gluetun for example) then this will recognize that.

  • Restart Gluetun -> restart dependencies
  • Stop Gluetun -> stop dependencies
  • Update Gluetun -> re-create dependencies and update the network mode

Socket proxy users

If you use the docker socket proxy to control granular access to the docker sock then you do not need to add the path variable for /var/run/docker.sock

You do need to add an environment variable for DOCKER_HOST and it needs to be the ip:port to the proxy. If you use a hostname, make sure it is on the same network as Dockwatch so it can communicate. The CONTAINERS variable in the proxy settings will need to be enabled as well.

Permissions

No matter how docker is installed (native, unraid, etc), it is required that the user running the container has permission to use the docker commands. View root/app/www/public/functions/docker.php to see what is used

Unraid: This is built into the container with

addgroup -g 281 unraiddocker && \
usermod -aG unraiddocker abc

Ubuntu: This is an example to get the group id to use

grep docker /etc/group

Run

This is just an example; change the TZ, PGID, network and volume paths accordingly

docker run \
  -d \
  --name "/dockwatch" \
  --volume "/home/dockwatch/config:/config:rw" \
  --volume "/var/run/docker.sock:/var/run/docker.sock:rw" \
  --restart "unless-stopped" \
  --publish "9999:80/tcp" \
  --network "bridge" \
  --env "TZ=America/New_York" \
  --env "PGID=122" \
  "ghcr.io/notifiarr/dockwatch:main"

Compose

This is an example, adjust paths and settings for your setup

version: "2.1"
services:
  dockwatch:
    container_name: dockwatch
    image: ghcr.io/notifiarr/dockwatch:main
    ports:
      - 9999:80/tcp
    environment:
      - PGID=999
      - TZ=America/New_York
    volumes:
      - /home/dockwatch/config:/config
      - /var/run/docker.sock:/var/run/docker.sock

Manual

docker pull ghcr.io/notifiarr/dockwatch:main

ENV

These are my settings, adjust them to fit your setup!!

Volumes

Name Host Container
App Config /mnt/disk1/appdata/dockwatch/config /config
Docker sock /var/run/docker.sock /var/run/docker.sock

Ports

Inside Outside
80 9999

Variables

Name Key Value
PUID PUID 1001
PGID PGID 100

Login

There is support for a simple login mechanism but i would recomment using something like a reverse proxy with authentication

  • Add a file logins to /config
  • Add admin:password to the file and save it
  • Reload
  • Multiple logins, drop a line and add another admin:password

Development

Firstly i am not a docker expert so there are likely other/better ways to do this. What i list below is just how i work on it without having to rebuild the container for every change and a reminder for me on what i did. Since this involves messing with the contents of the container, if an update is applied these steps will need re-applied

Option 1:

  • Fork the repo
  • Open the Dockerfile and comment out the COPY root/ / line at the bottom
  • Copy the files from root/app/www/public/* to /config/www/*
  • Copy the cron feom root/etc/crontabs/abc to /config/crontabs/abc (You'll need to add an ENV variable for DOCKER_MODS=linuxserver/mods:universal-cron)
  • Copy the ini from root/etc/php82/conf.d/dockwatch.ini to /config/php/php-local.ini
  • This should allow you to run the container while making changes to the files in /config and when done, just copy the files back into the root/ directories and push your fork so it builds a new container

Option 2:

  • SSH into the container as root
  • Run chown -R abc:abc /app/www
  • Open the UI to Settings -> Development and change the environment from Internal to External & save
  • Restart the container and it is now looking at /config/www for the working files so make sure you copy the files to there!

Icons

Unraid:

  • Icons show up automatically using unraid labels

Non-Unraid:

Screenshots

UI

image image image image image image image image

Notifications

image image image image image image

dockwatch's People

Contributors

austinwbest avatar nzxl101 avatar davidnewhall avatar genomez avatar spider1163 avatar bakerboy448 avatar brymck1 avatar

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.