Deployment Kit

# Deployment Kit Skill

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "Deployment Kit" with this command: npx skills add yuyonghao-123/yuyonghao-deployment-kit

Deployment Kit Skill

version: 0.1.0

OpenClaw 生产部署套件 - Docker + CI/CD + 健康检查

功能特性

  • Docker 容器化: 多阶段构建,优化镜像大小
  • Docker Compose: 一键启动完整服务栈
  • CI/CD 流水线: GitHub Actions 自动构建、测试、部署
  • 健康检查: 网关、磁盘、内存、日志监控
  • 安全扫描: Trivy 漏洞扫描

快速开始

1. Docker 部署

cd skills/deployment-kit

# 构建镜像
npm run docker:build

# 运行容器
npm run docker:run

# 查看日志
docker logs -f openclaw

2. Docker Compose 部署

cd docker

# 启动所有服务
docker-compose up -d

# 查看状态
docker-compose ps

# 查看日志
docker-compose logs -f openclaw

3. 健康检查

# 本地检查
npm run health:check

# 或直接使用脚本
node scripts/health-check.js

目录结构

deployment-kit/
├── docker/
│   ├── Dockerfile          # 多阶段构建
│   └── docker-compose.yml  # 完整服务栈
├── .github/workflows/
│   └── ci-cd.yml          # GitHub Actions
├── scripts/
│   └── health-check.js    # 健康检查
└── package.json

CI/CD 流水线

工作流阶段

  1. Lint: 代码风格检查
  2. Test: 多版本 Node.js 测试
  3. Build: 构建 Docker 镜像
  4. Security: Trivy 安全扫描
  5. Deploy: 自动部署到 staging/production

触发条件

  • Push to develop: 部署到测试环境
  • Push to main: 部署到生产环境
  • Release published: 构建版本镜像

健康检查

检查项

检查项说明阈值
Gateway网关 HTTP 响应200 OK
Disk Space磁盘使用率Warning: 80%, Critical: 90%
Memory内存使用率Warning: 80%, Critical: 90%
Logs近期错误数Warning: >10 错误

使用示例

import { runHealthChecks } from './scripts/health-check.js';

const result = await runHealthChecks();
console.log(result);
// {
//   gateway: { status: 'ok' },
//   disk: { status: 'ok', usage: '45%' },
//   memory: { status: 'ok', usage: '60%' },
//   logs: { status: 'ok', recentErrors: 0 }
// }

Docker 镜像

构建参数

# 基础镜像
FROM node:20-alpine

# 非 root 用户
USER openclaw

# 健康检查
HEALTHCHECK --interval=30s --timeout=3s \
  CMD curl -f http://localhost:18789/health || exit 1

镜像特性

  • ✅ 多阶段构建(优化大小)
  • ✅ 非 root 用户运行(安全)
  • ✅ 时区设置(Asia/Shanghai)
  • ✅ 健康检查(自动重启)
  • ✅ 数据持久化(Volumes)

配置

环境变量

变量说明默认值
NODE_ENV运行环境production
TZ时区Asia/Shanghai
OPENCLAW_CONFIG配置文件路径/app/config/openclaw.json

端口映射

端口服务说明
18789OpenClaw Gateway主服务端口
9090Prometheus监控(可选)
3100Loki日志(可选)

监控(可选)

Prometheus + Grafana

# docker-compose.yml 已包含
services:
  prometheus:
    image: prom/prometheus:latest
    ports:
      - "9090:9090"
  
  grafana:
    image: grafana/grafana:latest
    ports:
      - "3000:3000"

注意事项

  1. 首次运行: 需要配置 OPENAI_API_KEY 等环境变量
  2. 数据持久化: 使用 Docker Volumes 保存数据
  3. 日志管理: 定期清理日志文件,避免磁盘满
  4. 安全: 生产环境使用 HTTPS,配置防火墙

License

MIT

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

Vnsh Skill

Securely share files using encrypted, expiring vnsh.dev links with the vnsh CLI for uploading and decrypting shared content.

Registry SourceRecently Updated
Coding

Notion

Notion API for creating and managing pages, databases, blocks, relations, rollups, and multi-workspace profiles via the notioncli CLI tool.

Registry SourceRecently Updated
Coding

Lybic Sandbox

Lybic Sandbox is a cloud sandbox built for agents and automation workflows. Think of it as a disposable cloud computer you can spin up on demand. Agents can perform GUI actions like seeing the screen, clicking, typing, and handling pop ups, which makes it a great fit for legacy apps and complex flows where APIs are missing or incomplete. It is designed for control and observability. You can monitor execution in real time, stop it when needed, and use logs and replay to debug, reproduce runs, and evaluate reliability. For long running tasks, iterative experimentation, or sensitive environments, sandboxed execution helps reduce risk and operational overhead.

Registry SourceRecently Updated
1.2K0aenjoy
Coding

Homeassistant Skill

Control Home Assistant devices and automations via REST API. 25 entity domains including lights, climate, locks, presence, weather, calendars, notifications, scripts, and more. Use when the user asks about their smart home, devices, or automations.

Registry SourceRecently Updated
5.1K7anotb