publog

Deploy Publog centralized log viewer - supports Docker Compose, Docker Swarm, Kubernetes, or standalone binary

Recipaie - 部署配方

描述如何部署此服务的模板。

原始 JSON
{
  "$schema": "https://recipaie.com/schemas/recipaie.schema.json",
  "name": "publog",
  "version": "1.0.0",
  "description": "Deploy Publog centralized log viewer - supports Docker Compose, Docker Swarm, Kubernetes, or standalone binary",
  "prerequisites": [
    "Redis 7+ with RediSearch module (Redis Stack recommended)",
    "One of: Docker, Docker Swarm, Kubernetes, or a Linux server for standalone deployment",
    "Network access to log.dixt.io for MCP client, or self-hosted instance"
  ],
  "steps": [
    {
      "order": 1,
      "what": "Determine deployment method",
      "why": "Publog can run in multiple environments - choose what fits your infrastructure",
      "when": "Before starting deployment",
      "how": "Assess your environment: (1) Docker Compose for single-node dev/small prod, (2) Docker Swarm for multi-node clusters, (3) Kubernetes for K8s clusters, (4) Standalone binary for non-containerized servers",
      "verify": "Deployment method chosen and noted",
      "comments": [
        "All methods use the same publog binary from binary.dixt.io",
        "Standalone binary is simplest - just download and run",
        "Container methods provide isolation and orchestration"
      ]
    },
    {
      "order": 2,
      "what": "Ensure Redis with RediSearch is available",
      "why": "Publog requires Redis Stack (Redis + RediSearch) for full-text log search",
      "when": "Before deploying publog service",
      "skip_if": "Redis with RediSearch already running and accessible",
      "how": "Deploy Redis Stack: (Docker) docker run -d --name redis-stack redis/redis-stack:latest, (K8s) use redis-stack helm chart, (Standalone) install redis-stack-server package",
      "verify": "redis-cli PING returns PONG, and FT._LIST works (RediSearch loaded)",
      "comments": [
        "Standard Redis without RediSearch will NOT work - search features require RediSearch",
        "Redis Stack includes Redis + RediSearch + RedisJSON",
        "For production: configure persistence and memory limits"
      ]
    },
    {
      "order": 3,
      "what": "Download publog binary",
      "why": "Publog is distributed as a static Go binary via pubbin",
      "when": "When deploying new or updating existing installation",
      "skip_if": "Current publog version matches target version",
      "how": "Download from https://binary.dixt.io/download/publog/{version}/{platform} where platform is linux-amd64, linux-arm64, darwin-amd64, or darwin-arm64",
      "verify": "./publog --version shows expected version",
      "comments": [
        "Binary is ~15-20MB, statically compiled (CGO_ENABLED=0)",
        "For containers: mount binary into Alpine container",
        "Auto-update available if BINARY_REPO_KEY is configured"
      ]
    },
    {
      "order": 4,
      "what": "Configure environment variables",
      "why": "Publog needs Redis connection and optional settings",
      "when": "Before starting the service",
      "how": "Set environment variables: REDIS_HOST (required), REDIS_PORT (default 6379), PORT (HTTP port, default 8080), BINARY_REPO_KEY (optional, for auto-updates)",
      "verify": "Environment variables are set and accessible to the service",
      "comments": [
        "For Docker: use -e flags or env_file",
        "For K8s: use ConfigMap/Secret",
        "For systemd: use Environment= in unit file",
        "For standalone: export in shell or .env file"
      ]
    },
    {
      "order": 5,
      "what": "Deploy the service",
      "why": "Start publog using your chosen deployment method",
      "when": "After configuration is ready",
      "how": "Choose method: (Docker Compose) docker compose up -d, (Docker Swarm) docker stack deploy -c compose.yml publog, (Kubernetes) kubectl apply -f publog-deployment.yaml, (Standalone) ./publog or use systemd service",
      "verify": "curl http://localhost:8080/health returns {\"status\":\"ok\"}",
      "comments": [
        "For production: place behind reverse proxy (Traefik, nginx, Ingress)",
        "Health endpoint doesn't require authentication",
        "Logs available at stdout (Docker) or via journalctl (systemd)"
      ]
    },
    {
      "order": 6,
      "what": "Verify log ingestion",
      "why": "Confirm services can send logs to publog",
      "when": "After service is running",
      "how": "Send a test log via API or configure Publifye Logger in your services to point to this publog instance",
      "verify": "Query logs via API or MCP - logs should appear within seconds"
    }
  ],
  "step_count": 6
}
版本: 1.0.0
步骤数: 6

前置条件

步骤

1 Determine deployment method
为什么
Publog can run in multiple environments - choose what fits your infrastructure
何时做
Before starting deployment
如何做
Assess your environment: (1) Docker Compose for single-node dev/small prod, (2) Docker Swarm for multi-node clusters, (3) Kubernetes for K8s clusters, (4) Standalone binary for non-containerized servers
验证
Deployment method chosen and noted
备注
  • All methods use the same publog binary from binary.dixt.io
  • Standalone binary is simplest - just download and run
  • Container methods provide isolation and orchestration
2 Ensure Redis with RediSearch is available
为什么
Publog requires Redis Stack (Redis + RediSearch) for full-text log search
何时做
Before deploying publog service
何时跳过
Redis with RediSearch already running and accessible
如何做
Deploy Redis Stack: (Docker) docker run -d --name redis-stack redis/redis-stack:latest, (K8s) use redis-stack helm chart, (Standalone) install redis-stack-server package
验证
redis-cli PING returns PONG, and FT._LIST works (RediSearch loaded)
备注
  • Standard Redis without RediSearch will NOT work - search features require RediSearch
  • Redis Stack includes Redis + RediSearch + RedisJSON
  • For production: configure persistence and memory limits
3 Download publog binary
为什么
Publog is distributed as a static Go binary via pubbin
何时做
When deploying new or updating existing installation
何时跳过
Current publog version matches target version
如何做
Download from https://binary.dixt.io/download/publog/{version}/{platform} where platform is linux-amd64, linux-arm64, darwin-amd64, or darwin-arm64
验证
./publog --version shows expected version
备注
  • Binary is ~15-20MB, statically compiled (CGO_ENABLED=0)
  • For containers: mount binary into Alpine container
  • Auto-update available if BINARY_REPO_KEY is configured
4 Configure environment variables
为什么
Publog needs Redis connection and optional settings
何时做
Before starting the service
如何做
Set environment variables: REDIS_HOST (required), REDIS_PORT (default 6379), PORT (HTTP port, default 8080), BINARY_REPO_KEY (optional, for auto-updates)
验证
Environment variables are set and accessible to the service
备注
  • For Docker: use -e flags or env_file
  • For K8s: use ConfigMap/Secret
  • For systemd: use Environment= in unit file
  • For standalone: export in shell or .env file
5 Deploy the service
为什么
Start publog using your chosen deployment method
何时做
After configuration is ready
如何做
Choose method: (Docker Compose) docker compose up -d, (Docker Swarm) docker stack deploy -c compose.yml publog, (Kubernetes) kubectl apply -f publog-deployment.yaml, (Standalone) ./publog or use systemd service
验证
curl http://localhost:8080/health returns {"status":"ok"}
备注
  • For production: place behind reverse proxy (Traefik, nginx, Ingress)
  • Health endpoint doesn't require authentication
  • Logs available at stdout (Docker) or via journalctl (systemd)
6 Verify log ingestion
为什么
Confirm services can send logs to publog
何时做
After service is running
如何做
Send a test log via API or configure Publifye Logger in your services to point to this publog instance
验证
Query logs via API or MCP - logs should appear within seconds

Prodaie - 执行记录

AI 在不同环境中执行这份配方时发生了什么。

关键区别: 每一步都会增加

success

(bool)和

details

(string)字段,用于记录实际发生了什么。

原始 JSON
{
  "$schema": "https://recipaie.com/schemas/prodaie.schema.json",
  "name": "publog",
  "description": "Deployment record of Publog to production (Docker Swarm) and staging (Kubernetes) environments",
  "locations": [
    {
      "path": "prod-server-01 (Docker Swarm)",
      "description": "Production deployment on Docker Swarm cluster",
      "status": "complete",
      "step_count": 6,
      "steps": [
        {
          "order": 1,
          "what": "Determine deployment method",
          "why": "Publog can run in multiple environments - choose what fits your infrastructure",
          "when": "Before starting deployment",
          "how": "Assess your environment",
          "verify": "Deployment method chosen and noted",
          "success": true,
          "details": "chose Docker Swarm for multi-node HA deployment"
        },
        {
          "order": 2,
          "what": "Ensure Redis with RediSearch is available",
          "why": "Publog requires Redis Stack for full-text log search",
          "when": "Before deploying publog service",
          "skip_if": "Redis with RediSearch already running",
          "how": "Deploy Redis Stack",
          "verify": "redis-cli PING returns PONG",
          "success": true,
          "details": "Redis Stack already running at redis.internal:6379"
        },
        {
          "order": 3,
          "what": "Download publog binary",
          "why": "Publog is distributed as a static Go binary via pubbin",
          "when": "When deploying new or updating existing installation",
          "skip_if": "Current publog version matches target version",
          "how": "Download from binary.dixt.io",
          "verify": "./publog --version shows expected version",
          "success": true,
          "details": "downloaded v0.3.2 for linux-amd64"
        },
        {
          "order": 4,
          "what": "Configure environment variables",
          "why": "Publog needs Redis connection and optional settings",
          "when": "Before starting the service",
          "how": "Set environment variables in compose.yml",
          "verify": "Environment variables are set",
          "success": true,
          "details": "configured REDIS_HOST, PORT, BINARY_REPO_KEY in compose.yml"
        },
        {
          "order": 5,
          "what": "Deploy the service",
          "why": "Start publog using Docker Swarm",
          "when": "After configuration is ready",
          "how": "docker stack deploy -c compose.yml publog",
          "verify": "curl http://localhost:8080/health returns ok",
          "success": true,
          "details": "service deployed, health check passing"
        },
        {
          "order": 6,
          "what": "Verify log ingestion",
          "why": "Confirm services can send logs to publog",
          "when": "After service is running",
          "how": "Check logs via MCP",
          "verify": "Query logs via API or MCP",
          "success": true,
          "details": "logs from 12 services visible within seconds"
        }
      ]
    },
    {
      "path": "staging-k8s (Kubernetes)",
      "description": "Staging deployment on Kubernetes cluster",
      "status": "complete",
      "step_count": 6,
      "steps": [
        {
          "order": 1,
          "what": "Determine deployment method",
          "why": "Publog can run in multiple environments",
          "when": "Before starting deployment",
          "how": "Assess your environment",
          "verify": "Deployment method chosen",
          "success": true,
          "details": "chose Kubernetes for integration with existing K8s cluster"
        },
        {
          "order": 2,
          "what": "Ensure Redis with RediSearch is available",
          "why": "Publog requires Redis Stack for full-text log search",
          "when": "Before deploying publog service",
          "skip_if": "Redis with RediSearch already running",
          "how": "Deploy Redis Stack via Helm",
          "verify": "redis-cli PING returns PONG",
          "success": true,
          "details": "deployed Bitnami Redis Stack helm chart to redis namespace"
        },
        {
          "order": 3,
          "what": "Download publog binary",
          "why": "Publog is distributed as a static Go binary",
          "when": "When deploying new or updating",
          "skip_if": "Current version matches target",
          "how": "Build container image with binary",
          "verify": "Container image built successfully",
          "success": true,
          "details": "built publog:0.3.2 image with alpine base"
        },
        {
          "order": 4,
          "what": "Configure environment variables",
          "why": "Publog needs Redis connection",
          "when": "Before starting the service",
          "how": "Create ConfigMap and Secret",
          "verify": "kubectl get configmap publog-config",
          "success": true,
          "details": "created ConfigMap with REDIS_HOST pointing to redis-stack.redis.svc"
        },
        {
          "order": 5,
          "what": "Deploy the service",
          "why": "Start publog using Kubernetes",
          "when": "After configuration is ready",
          "how": "kubectl apply -f publog-deployment.yaml",
          "verify": "kubectl get pods -l app=publog shows Running",
          "success": true,
          "details": "2 replicas running behind ClusterIP service"
        },
        {
          "order": 6,
          "what": "Verify log ingestion",
          "why": "Confirm services can send logs",
          "when": "After service is running",
          "how": "Port-forward and check",
          "verify": "Logs visible via API",
          "success": true,
          "details": "ingress configured, logs flowing from staging apps"
        }
      ]
    }
  ]
}
安装位置: 2

安装位置

prod-server-01 (Docker Swarm) complete

Production deployment on Docker Swarm cluster

步骤数: 6
1 Determine deployment method
为什么
Publog can run in multiple environments - choose what fits your infrastructure
何时做
Before starting deployment
如何做
Assess your environment
验证
Deployment method chosen and noted
结果
chose Docker Swarm for multi-node HA deployment
2 Ensure Redis with RediSearch is available
为什么
Publog requires Redis Stack for full-text log search
何时做
Before deploying publog service
何时跳过
Redis with RediSearch already running
如何做
Deploy Redis Stack
验证
redis-cli PING returns PONG
结果
Redis Stack already running at redis.internal:6379
3 Download publog binary
为什么
Publog is distributed as a static Go binary via pubbin
何时做
When deploying new or updating existing installation
何时跳过
Current publog version matches target version
如何做
Download from binary.dixt.io
验证
./publog --version shows expected version
结果
downloaded v0.3.2 for linux-amd64
4 Configure environment variables
为什么
Publog needs Redis connection and optional settings
何时做
Before starting the service
如何做
Set environment variables in compose.yml
验证
Environment variables are set
结果
configured REDIS_HOST, PORT, BINARY_REPO_KEY in compose.yml
5 Deploy the service
为什么
Start publog using Docker Swarm
何时做
After configuration is ready
如何做
docker stack deploy -c compose.yml publog
验证
curl http://localhost:8080/health returns ok
结果
service deployed, health check passing
6 Verify log ingestion
为什么
Confirm services can send logs to publog
何时做
After service is running
如何做
Check logs via MCP
验证
Query logs via API or MCP
结果
logs from 12 services visible within seconds
staging-k8s (Kubernetes) complete

Staging deployment on Kubernetes cluster

步骤数: 6
1 Determine deployment method
为什么
Publog can run in multiple environments
何时做
Before starting deployment
如何做
Assess your environment
验证
Deployment method chosen
结果
chose Kubernetes for integration with existing K8s cluster
2 Ensure Redis with RediSearch is available
为什么
Publog requires Redis Stack for full-text log search
何时做
Before deploying publog service
何时跳过
Redis with RediSearch already running
如何做
Deploy Redis Stack via Helm
验证
redis-cli PING returns PONG
结果
deployed Bitnami Redis Stack helm chart to redis namespace
3 Download publog binary
为什么
Publog is distributed as a static Go binary
何时做
When deploying new or updating
何时跳过
Current version matches target
如何做
Build container image with binary
验证
Container image built successfully
结果
built publog:0.3.2 image with alpine base
4 Configure environment variables
为什么
Publog needs Redis connection
何时做
Before starting the service
如何做
Create ConfigMap and Secret
验证
kubectl get configmap publog-config
结果
created ConfigMap with REDIS_HOST pointing to redis-stack.redis.svc
5 Deploy the service
为什么
Start publog using Kubernetes
何时做
After configuration is ready
如何做
kubectl apply -f publog-deployment.yaml
验证
kubectl get pods -l app=publog shows Running
结果
2 replicas running behind ClusterIP service
6 Verify log ingestion
为什么
Confirm services can send logs
何时做
After service is running
如何做
Port-forward and check
验证
Logs visible via API
结果
ingress configured, logs flowing from staging apps