cm = container monitor - Monitor docker containers, auto-updates, view logs, start, stop, restart.
6.3K
Container Monitor is a lightweight, containerized web application and background service for tracking, managing, and updating Docker containers. It provides a web interface for daily administration and an automated background script for monitoring container health and applying image updates.
latest tags or semver matching).The recommended deployment method utilizes Docker Compose and a Docker Socket Proxy to restrict the monitor's access to the host daemon.
Create a directory for persistent data and ensure the user running the container has ownership, as the container will map permissions to the host.
mkdir -p ./data
Create a docker-compose.yml file.
services:
dockerproxy:
image: lscr.io/linuxserver/socket-proxy:latest
container_name: dockerproxy
restart: unless-stopped
environment:
# Required for basic tracking
- CONTAINERS=1 # Allow listing, inspecting, and reading logs
- IMAGES=1 # Allow pulling images and checking digests
- INFO=1 # Allow 'docker info' for daemon connection checks
# Required for app actions
- POST=1 # Allow POST operations (Start, Stop, Restart, Pull, Recreate)
- EXEC=1 # Allow 'docker exec' for container disk/network stats gathering
- SYSTEM=1 # Allow 'docker system prune' for the UI cleanup button
# Required for compose recreation
- NETWORKS=1 # Needed for compose to attach containers to networks
- VOLUMES=1 # Needed for compose to attach existing volumes
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
read_only: true
tmpfs:
- /run
container-monitor:
image: iamdockin/cm:latest
container_name: container-monitor
hostname: myserver
restart: unless-stopped
depends_on:
- dockerproxy
ports:
- "9000:9000"
volumes:
- /:/hostfs:ro
- ./data:/app/data
- /opt/docker:/opt/docker # Map to your local compose directories
# Prevent Docker Hub limits and for private registries, log in on the host system with `docker login`
- ~/.docker/config.json:/root/.docker/config.json:ro
environment:
# System Configuration
- DOCKER_HOST=tcp://dockerproxy:2375
- DATA_DIR=/app/data
- HOST_DISK_CHECK_FILESYSTEM=/hostfs
- CONTAINER_MODE=true
- TZ=Europe/London
- SECRET_TOKEN=your_secure_password_here
# Optional Configuration Seeds (Populates config.yml on first boot)
- MONITOR_INTERVAL_HOURS=6
- UPDATE_CHECK_CACHE_HOURS=6
- CPU_WARNING_THRESHOLD=80
- MEMORY_WARNING_THRESHOLD=80
- DISK_SPACE_THRESHOLD=80
# Notifications
- NOTIFICATION_CHANNEL=none # Options: discord, ntfy, generic, none
- NOTIFY_ON=Updates,Logs,Status,Restarts,Resources
- DISCORD_WEBHOOK_URL=
- NTFY_SERVER_URL=https://ntfy.sh
- NTFY_TOPIC=
- NTFY_ACCESS_TOKEN=
- NTFY_PRIORITY=3
# Container Filters & Updates
- EXCLUDE_UPDATES=my-local-app-1,my-backend-api
- LOG_ERROR_PATTERNS=Exception,SEVERE,Traceback,panic,fatal
- AUTO_UPDATE_ENABLED=false
- AUTO_UPDATE_TAGS=latest,stable,main
- AUTO_UPDATE_EXCLUDE=postgres,redis,mongo
docker compose up -d
Access the web interface at http://<your-host-ip>:9000 and log in using the SECRET_TOKEN defined in your compose file.
The application uses a two-tier configuration system.
docker-compose.yml and generates a structured config.yml file in the mapped ./data directory. It also queries the Docker socket to automatically populate the monitoring list with currently running containers.config.yml is generated, it acts as the source of truth. You can modify this file directly via the web UI's "Settings" tab. The backend includes a strict YAML linter that validates syntax before saving changes to disk./var/run/docker.sock directly into the container-monitor container. Using the linuxserver/socket-proxy limits the attack surface by only exposing necessary API endpoints.SECRET_TOKEN in your environment variables. Without this token, the API will return HTTP 401 Unauthorized for all requests.working_dir of your containers must be mapped identically inside the container-monitor container (e.g., /opt/docker:/opt/docker) so the script can execute docker compose pull and up -d commands accurately during update cycles.Content type
Image
Digest
sha256:fe73cc23c…
Size
70.3 MB
Last updated
11 days ago
docker pull iamdockin/cm