HUB
Sign inSign up
mmonit logo

jchonig/mmonit

By jchonig

•Updated 7 days ago

M/Monit in a container, based on linuxserver.io Ubuntu base container

Image
2

10K+

jchonig/mmonit repository overview

⁠docker-mmonit

A container running M/Monit⁠.

Image hosted at: ghcr.io/ghcr.io/jchonig/mmonit

⁠Usage

⁠docker

docker create \
  --name=mmonit \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Europe/London \
  -e MMONIT_LICENSE_OWNER="Fred" \
  -e MMONIT_LICENSE_KEY="<M/Monit license key>" \
  --expose 8080 \
  -v </path/to/appdata/config>:/config \
  -v </path/to/backupdir>:/backup \
  --restart unless-stopped \
  ghcr.io/jchonig/mmonit
⁠docker-compose

Compatible with docker-compose v2 schemas.

---
version: "2"
services:
  monit:
    image: ghcr.io/jchonig/mmonit
    container_name: mmonit
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
      - MMONIT_LICENSE_OWNER="Fred"
      - MMONIT_LICENSE_KEY="<M/Monit license key>"
    volumes:
      - </path/to/appdata/config>:/config
      - </path/to/backupdir>:/backup
    expose:
      - 8080
    restart: unless-stopped

⁠Parameters

⁠Ports (--expose)

VolumeFunction
8080Used for web access and for clients to report in

⁠Environment Variables (-e)

EnvFunction
PUID=1000UserID, see below
PGID=1000GroupID, see below
TZ=UTCTimezone to use, e.g. UTC
MMONIT_VERSIONM/Monit version to build
MMONIT_LICENSE_OWNEROwner name from M/Monit license
MMONIT_LICENSE_KEYText of the M/Monit license
MMONIT_DATABASE_BACKUP_STATS"no" skips statistics tables in backups
MMONIT_BACKUP_TIMEOUTSeconds before a dump fails (1800)
MMONIT_DATABASE_URLURL to access the M/Monit database
MMONIT_LIMIT_FDOverride the default of 4096
MMONIT_TLS_VERSIONOverride the TLS version

⁠Volume Mappings (-v)

VolumeFunction
/configAll the config files reside here
/backupOptional location to store periodic backups

⁠Application Setup

  • Environment variables can also be passed in a file named env in the config directory. This file is sourced by the shell.
  • The M/Monit configuration directories are extracted into a directory in /config named monit-${MONIT_VERSION} unless it already exists.
  • It is recommended to use nginx as an SSL proxy for security.

⁠Backups

If the /backup volume is mounted, periodic (hourly, daily, weekly and monthly) backups will be created with a retention of (25 hours, 8 days, 5 weeks, and 12 months respectively). The onwership will be the container PUID and PGID.

Logs will be stored in /config/logs/backup.log and rotated monthly.

This has been tested with sqlite3 and mariadb. Backups of postgresql are not yet supported.

Also see MMONIT_DATABASE_BACKUP_STATS when using mariadb. On a slower system, dumping all the statistics can cause M/Monit to drop data and cause problems.

Backups can be run by hand by running /usr/local/bin/mmonit_backup. Specify a type with --type FOO to separate them from periodic backups.

⁠Upgrading

  • The container will automatically run the M/Monit upgrade script if /config/version indicates an older version was last run.
  • Old versions /config/mmonit-${MMONIT_VERSION} will need to be manually removed at this time.
  • If an upgrade fails, /config/.upgrade_failed will have contain the reason for the failure and M/Monit will not start until the issue is fixed and the file is removed.
  • If backups are configured, a full backup of the database will be done before the upgrade starts. If the upgrade fails, the database will be restored from the backup.

⁠More information

See the Wiki⁠.

Tag summary

Content type

Image

Digest

sha256:3a897ee5a…

Size

26.3 MB

Last updated

7 days ago

docker pull jchonig/mmonit