Nodevisor Docs
Services

Whoami

Test service for verifying Traefik routing and SSL configuration.

Overview

The Whoami service is a lightweight test container using the traefik/whoami image. It responds to HTTP requests with information about the request headers, host, and IP — useful for verifying that Traefik routing, SSL certificates, and domain configuration are working correctly.

Use it during initial cluster setup to confirm that traffic flows from your domain through Traefik to a backend service before deploying your actual application.

Quick Start

import { DockerCluster, Traefik, Whoami } from '@nodevisor/docker';

const cluster = new DockerCluster({ name: 'production', ... });

const traefik = new Traefik({
  ssl: { email: 'ops@example.com', redirect: true },
});

cluster.addDependency(traefik);

cluster.addDependency(new Whoami({
  domains: ['test.example.com'],
  proxy: traefik,
}));

After deploying, visit https://test.example.com to see request details.

Configuration

WhoamiConfig

OptionTypeDefaultDescription
namestring'whoami'Service name
imagestring'traefik/whoami'Docker image
domainsstring[]requiredDomains to route to this service
proxyWebProxy | WebProxyDependencyrequiredReverse proxy for routing
portnumber80Application port inside the container
environmentRecord<string, string>undefinedEnvironment variables

Usage with DockerCluster

A common pattern is to add Whoami alongside your real services during initial setup:

import {
  DockerCluster, DockerNode, ClusterUser,
  Traefik, Whoami, DockerRegistry,
} from '@nodevisor/docker';

const cluster = new DockerCluster({
  name: 'staging',
  nodes: [new DockerNode({ host: '10.0.0.1' })],
  users: [new ClusterUser({ username: 'root', privateKeyPath: '~/.ssh/id_ed25519' })],
  registry: new DockerRegistry({
    server: 'ghcr.io',
    username: 'myorg',
    password: process.env.REGISTRY_TOKEN!,
  }),
});

const traefik = new Traefik({
  ssl: { email: 'ops@example.com', redirect: true },
});

cluster.addDependency(traefik);

// Test service to verify routing
cluster.addDependency(new Whoami({
  domains: ['test.example.com'],
  proxy: traefik,
}));

await cluster.setup();
await cluster.deploy();

// Visit https://test.example.com to verify
// Once confirmed, replace Whoami with your real services

On this page