# docker-compose.yml — nginx-logtail container stack # # One multi-arch image ships all four binaries (built by the companion # Dockerfile). Each service below picks which binary it runs via # `command:`. Services are opt-in via Docker Compose "profiles": # # cp .env.example .env # $EDITOR .env # set COMPOSE_PROFILES and tunables # docker compose up -d # # Valid profile names: collector, aggregator, frontend. # # Typical deployments: # # COMPOSE_PROFILES=aggregator,frontend # central host (default) # COMPOSE_PROFILES=collector # nginx host running only the collector in Docker # COMPOSE_PROFILES=collector,aggregator,frontend # single-host all-in-one # # See .env.example for every tunable. services: collector: profiles: [collector] build: context: . dockerfile: Dockerfile image: git.ipng.ch/ipng/nginx-logtail:latest container_name: nginx-logtail-collector restart: unless-stopped command: ["/usr/local/bin/collector"] env_file: .env # Host networking is the simplest way to accept UDP datagrams from a # host nginx on 127.0.0.1:9514 — bridge networking with port mapping # does not round-trip packets that never leave loopback. Mac/Windows # Docker Desktop users must switch to a bridge + explicit # COLLECTOR_LOGTAIL_BIND. network_mode: host # Mount nginx log directory so the file tailer can read it. Harmless # when COLLECTOR_LOGS is empty (the collector simply runs UDP-only). volumes: - /var/log/nginx:/var/log/nginx:ro aggregator: profiles: [aggregator] build: context: . dockerfile: Dockerfile image: git.ipng.ch/ipng/nginx-logtail:latest container_name: nginx-logtail-aggregator restart: unless-stopped command: ["/usr/local/bin/aggregator"] env_file: .env ports: - "9091:9091" # gRPC frontend: profiles: [frontend] build: context: . dockerfile: Dockerfile image: git.ipng.ch/ipng/nginx-logtail:latest container_name: nginx-logtail-frontend restart: unless-stopped command: ["/usr/local/bin/frontend"] env_file: .env ports: - "8080:8080" # HTTP dashboard