HUB
Sign inSign up
containeryard logo

0xwulf/containeryard

By 0xwulf

โ€ขUpdated about 7 hours ago

Self-hosted Docker dashboard: live logs, Compose stack & container actions, metrics. amd64 + arm64

Image
Monitoring & observability
1

2.0K

0xwulf/containeryard repository overview

โ ContainerYard ๐Ÿณ

Self-hosted Docker observability dashboard: live logs, stack and container actions, metrics and an audit trail in one fast, light/dark web UI.

Website GitHub Release License: MIT

ContainerYard dashboard (light theme)

ContainerYard sits between a bare log viewer and a full monitoring stack. Point it at your Docker socket and you get a log-first dashboard for every container and Compose stack on the host. It also shows read-only container overviews for remote hosts through cAdvisor.


โ โœจ Features

  • Real-time logs: live tail over SSE, virtualized rendering for huge logs, regex and level filters, and a query DSL (level:warn..error, service:auth, -"healthcheck").
  • Log analysis: interleave up to 3 containers, log-rate heatmap with spike detection, restart before/after comparison, JSON field chips, and Log Moment bookmarks with deep links.
  • Compose stacks: automatic grouping by project, health badges, and stack-level metrics. ADMINs can start, stop or restart a stack after a confirmation step.
  • Container actions: start, stop, restart, pause, unpause and remove, for ADMINs only. They're rate-limited and every attempt is audited.
  • Metrics: live CPU, memory and network stats per container and per host. Clicking a metric spike opens the logs for that time window.
  • Web terminal: an xterm.js shell into a container for debugging.
  • Users and roles: ADMIN / VIEWER roles, self-service password change, and an ADMIN user-management modal. Sessions are revoked instantly on password reset, role change or deletion.
  • Security by default: CSRF tokens on every write, bcrypt (cost 12), login rate limiting, Helmet headers, Secure session cookies in Redis, an SSRF-safe webhook client, and an audit log of logins and actions.
  • Light/dark UI: light by default, a persistent toggle on every page, no flash on load, and WCAG AA contrast in both themes.
LightDark
Dashboard, lightDashboard, dark
Host logs, lightHeader actions, mobile dark
AboutUser administration (ADMIN)
About modalUser administration modal

โ ๐Ÿท๏ธ Tags

TagMeaning
4.0.0Exact release (recommended for production; pin it)
4.0Latest patch of the 4.0 line
latestMost recent stable release

Every tag is a multi-arch image for linux/amd64 and linux/arm64 (it runs on a Raspberry Pi 4/5), and each release ships with an SBOM and SLSA provenance attestations. Releases are built by GitHub Actions from signed vX.Y.Z tags. See the changelogโ .


โ ๐Ÿš€ Quick start (Docker Compose)

The supported way to run ContainerYard is the repository's docker-compose.yml. It starts the app plus a private Redis for sessions.

git clone https://github.com/hexawulf/ContainerYard.git && cd ContainerYard
cp .env.example .env && nano .env      # set the required variables below
docker compose pull
docker compose up -d
docker compose ps                      # app should turn "healthy" within ~30 s

The UI listens on 127.0.0.1:5008 by default. Put a TLS reverse proxy (nginx, Caddy, Traefik) in front of it and forward X-Forwarded-Proto: https: session cookies are Secure and Express trusts one proxy hop.

On first start the container creates the SQLite schema and the bootstrap ADMIN account from ADMIN_EMAIL / ADMIN_PASSWORD. Changing those variables later has no effect, so use the in-app password change or user admin instead.

โ What's in the stack
ServiceImageNotes
app0xwulf/containeryard:${CY_TAG:-latest}Port 5008, volume cy-data โ†’ /data (SQLite), Docker socket mount
redisredis:7-alpine (digest-pinned)Session store, AOF persistence, internal network only, volume cy-redis

Both services run with a read-only root filesystem, cap_drop: [ALL] and no-new-privileges, and carry com.centurylinklabs.watchtower.enable=false so upgrades stay deliberate.


โ โš™๏ธ Configuration

Required variables (the entrypoint and env.ts validate them and stop with a clear error, without printing values):

VariablePurpose
SESSION_SECRETSession signing secret, โ‰ฅ 32 chars (openssl rand -hex 32)
REDIS_PASSWORDPassword for the bundled Redis (openssl rand -hex 24)
ADMIN_EMAIL / ADMIN_PASSWORDBootstrap ADMIN, used only while the user table is empty (password 12 chars to 72 UTF-8 bytes)
ALLOWED_ORIGINSComma-separated origins, e.g. https://dash.example.com
PIAPPS2_CADVISOR_URL, SYNOLOGY_CADVISOR_URLcAdvisor URLs of the remote hosts defined in server/src/config/hosts.ts (edit that file to describe your own hosts)

Useful optional variables:

VariableDefaultPurpose
CY_TAGlatestImage tag used by compose
CY_BIND / CY_PORT127.0.0.1 / 5008Host bind address and port
DOCKER_GID / ADM_GID113 / 4Host GIDs for the Docker socket and (optional) nginx logs; check with getent group docker adm
COOKIE_SAMESITEnoneUse lax when UI and API share one origin
METRICS_TOKENunsetBearer token for the Prometheus /metrics endpoint
AUDIT_RETENTION_DAYS180Audit log retention
HOSTLOG_NGINX_DIR, PM2_LOG_DIR/var/log/nginx, ~/.pm2/logsHost log locations for the ADMIN Host Logs page
CY_SKIP_DB_PUSH01 skips the schema sync + seed on boot

The full table is in the READMEโ .

โ Host logs (optional)

To let ADMINs read host nginx and PM2 logs, mount them read-only with the example overlay:

docker compose -f docker-compose.yml -f deploy/piapps/docker-compose.piapps.yml up -d

It mounts /var/log/nginx:/host/nginx:ro and the PM2 log dir at /host/pm2:ro. Missing directories just show as "not available".


โ ๐Ÿ’พ Data, backup and upgrades

VolumeContains
cy-data (/data/app.db)Users, audit log, log bookmarks, saved searches (SQLite)
cy-redis (/data)Login sessions (AOF)
# Back up the database
docker run --rm -v containeryard_cy-data:/data:ro -v "$PWD:/backup" \
  --entrypoint /bin/cp 0xwulf/containeryard:latest -a /data/app.db /backup/app.db.bak

# Upgrade to a new release
CY_TAG=4.0.0 docker compose pull && CY_TAG=4.0.0 docker compose up -d

PostgreSQL is supported via DATABASE_URL=postgresql://โ€ฆ and enables alert rules and historical metrics, which are disabled on SQLite.


โ ๐Ÿ”’ Security notes

  • The Docker socket is root-equivalent. ContainerYard needs it for logs, stats and lifecycle actions. The app runs as unprivileged uid 1000 and is bound to localhost by default. Never publish port 5008 to the internet without the TLS proxy and login in front of it, and never expose dockerd on unauthenticated TCP (:2375). Monitor other hosts with cAdvisor instead.
  • Write access is gated by role: VIEWERs can watch, while only ADMINs can act, read host logs or manage users.
  • Found a vulnerability? Please report it privately to [email protected]โ  rather than in a public issue.

โ ๐Ÿ—๏ธ Under the hood

ComponentDetails
Base imagenode:22-bookworm-slim (digest-pinned), tini as PID 1
Health checkBuilt-in Node fetch against /health
FrontendReact 18, Vite, TypeScript, Tailwind CSS, shadcn/ui + Radix, TanStack Query, xterm.js, Recharts, wouter
BackendNode.js 22, Express, Dockerode, Zod, Helmet
Data and authPrisma (SQLite or PostgreSQL), Redis sessions (connect-redis), bcrypt, CSRF tokens
Labelsorg.opencontainers.image.{version,revision,source,licenses}

Licensed under the MIT License.

Tag summary

Content type

Image

Digest

sha256:f921ff795โ€ฆ

Size

167.4 MB

Last updated

about 7 hours ago

docker pull 0xwulf/containeryard