dozzle

GitHub

Realtime log viewer for containers. Supports Docker, Swarm and K8s.

RAW Compose
1. Pull Image docker pull library/alpine
2. 1-Click Launch Command docker run -d -p 8080:8080 --name dozzle alpine:3
3. Compose Deployment docker compose up -d
docker-compose.yml
Download .yml
x-dozzle-healthcheck: &dozzle-healthcheck
  test: ["CMD", "/dozzle", "healthcheck"]
  interval: 5s
  retries: 5
  start_period: 5s
  start_interval: 5s

services:
  custom_base:
    container_name: custom_base
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    environment:
      - DOZZLE_FILTER=name=custom_base
      - DOZZLE_BASE=/foobarbase
      - DOZZLE_NO_ANALYTICS=1
      - DOZZLE_HOSTNAME=custom name
    ports:
      - 8080:8080
    healthcheck: *dozzle-healthcheck
    build:
      context: .
  simple-auth:
    container_name: simple-auth
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./e2e/data:/data
    environment:
      - DOZZLE_AUTH_PROVIDER=simple
      - DOZZLE_NO_ANALYTICS=1
    healthcheck: *dozzle-healthcheck
    build:
      context: .
  dozzle:
    container_name: dozzle
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    environment:
      - DOZZLE_FILTER=name=dozzle
      - DOZZLE_NO_ANALYTICS=1
      - DOZZLE_HOSTNAME=localhost
      - DOZZLE_LEVEL=debug
    ports:
      - 7070:8080
    # Deliberately no healthcheck: this container is the subject of the visual
    # snapshots, and a healthcheck makes a health badge appear in the sidebar
    # (HostMenu.vue), which shifts the reference images.
    build:
      context: .
  # Dedicated instance + noisy container so log streaming can be asserted without
  # perturbing the `name=dozzle` filter the other instances rely on.
  logs-viewer:
    container_name: logs-viewer
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    environment:
      - DOZZLE_FILTER=name=logspam
      - DOZZLE_NO_ANALYTICS=1
      - DOZZLE_HOSTNAME=logs
    healthcheck: *dozzle-healthcheck
    build:
      context: .
    depends_on:
      - logspam
  logspam:
    container_name: logspam
    image: alpine:3
    command:
      - sh
      - -c
      - 'i=0; while true; do i=$$((i+1)); echo "logspam line $$i"; sleep 1; done'
  remote:
    container_name: remote
    environment:
      - DOZZLE_REMOTE_HOST=tcp://proxy:2375|remote-host
      - DOZZLE_FILTER=name=dozzle
      - DOZZLE_NO_ANALYTICS=1
    ports:
      - 5050:8080
    healthcheck: *dozzle-healthcheck
    build:
      context: .
    depends_on:
      proxy:
        condition: service_healthy
  dozzle-with-agent:
    container_name: with-agent
    environment:
      - DOZZLE_REMOTE_AGENT=agent:7007
      - DOZZLE_NO_ANALYTICS=1
      - DOZZLE_LEVEL=debug
    ports:
      - 8082:8080
    healthcheck: *dozzle-healthcheck
    build:
      context: .
    depends_on:
      agent:
        condition: service_healthy
  agent:
    container_name: agent
    command: agent
    environment:
      - DOZZLE_FILTER=name=dozzle
      - DOZZLE_NO_ANALYTICS=1
    healthcheck:
      test: ["CMD", "/dozzle", "healthcheck"]
      interval: 5s
      retries: 5
      start_period: 5s
      start_interval: 5s
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./e2e/data/notifications.yml:/data/notifications.yml:ro
    build:
      context: .
  proxy:
    container_name: proxy
    image: tecnativa/docker-socket-proxy
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    environment:
      - CONTAINERS=1
      # Dozzle calls /info on connect; without it the host never initializes and
      # lists zero containers.
      - INFO=1
    healthcheck:
      test: ["CMD", "nc", "-z", "127.0.0.1", "2375"]
      interval: 5s
      retries: 5
      start_period: 5s
      start_interval: 5s
    ports:
      - 2375:2375

  playwright:
    container_name: playwright
    image: mcr.microsoft.com/playwright:v1.62.1-jammy
    working_dir: /app
    volumes:
      - .:/app
    command: npx --yes playwright test
    environment:
      - PWTEST_SKIP_TEST_OUTPUT=1
      - CI=1
    depends_on:
      dozzle:
        condition: service_started
      custom_base:
        condition: service_healthy
      remote:
        condition: service_healthy
      simple-auth:
        condition: service_healthy
      dozzle-with-agent:
        condition: service_healthy
      logs-viewer:
        condition: service_healthy