Install
openclaw skills install @bustes01/deploy-agentAutomatically detects project type, generates Dockerfile if needed, builds and deploys the app in Docker with smart port selection and health checks.
openclaw skills install @bustes01/deploy-agentLocal deployment agent that auto-detects project types and deploys them via Docker. Default workflow: detect → Dockerfile generate → build → deploy.
skills/deploy-agent/
├── SKILL.md ← This file (instructions for OpenClaw agent)
├── scripts/
│ ├── deploy-agent.sh ← Main orchestrator (all-in-one CLI)
│ ├── bootstrap-docker.sh ← Install Docker Engine + Compose
│ ├── detect-project.sh ← Auto-detect project type
│ ├── generate-dockerfile.sh ← Generate Dockerfile dynamically
│ └── templates/
│ ├── Dockerfile.node ← Node.js template
│ ├── Dockerfile.python ← Python/Django template
│ ├── Dockerfile.go ← Go template
│ ├── Dockerfile.static ← Static Nginx template
│ ├── Dockerfile.java ← Java Maven template
│ └── entrypoint.django.sh ← Django entrypoint (migration + run)
| Feature | Description |
|---|---|
| Auto-detect | Identifies project type from file structure (Node.js, Python, Go, Rust, static HTML, Java, etc.) |
| Docker auto-gen | Generates Dockerfile if none exists |
| Compose native | Detects docker-compose.yml and deploys with compose |
| Smart ports | Auto-detects project port and finds next available |
| Health checks | Built-in HEALTHCHECK in every generated Dockerfile |
| Restart policy | Containers set to --restart unless-stopped |
| Managed tracking | All containers labeled with deploy-agent.managed=true |
# 1. Install Docker (first time only)
bash scripts/deploy-agent.sh install-docker
# 2. Detect a project
bash scripts/deploy-agent.sh detect ~/my-project
# 3. Deploy (auto-detect, generate Dockerfile, build, run)
bash scripts/deploy-agent.sh deploy ~/my-project
# 4. Deploy with specific port
bash scripts/deploy-agent.sh deploy ~/my-project 8080
# 5. List managed containers
bash scripts/deploy-agent.sh status
# 6. Stop a container
bash scripts/deploy-agent.sh stop my-project
# 7. View logs
bash scripts/deploy-agent.sh logs my-project
When the user says "帮我部署这个项目" or provides a project path:
The project path may come as:
~/projects/my-app)https://github.com/user/repo.git)# If Docker not available, install
bash <skill_dir>/scripts/bootstrap-docker.sh
Read detection output, confirm with user if ambiguous:
bash <skill_dir>/scripts/detect-project.sh <project_dir>
bash <skill_dir>/scripts/deploy-agent.sh deploy <project_dir>
Tell the user:
When user uploads project files:
/tmp/, ~/Downloads/, workspace paths)sudo usermod -aG docker $USER or newgrp dockernode_modules already present → COPY will be large. Suggest .dockerignore generationMain CLI: deploy-agent.sh <command> [args]
Commands: install-docker, detect, generate, build, deploy, status, stop, logs
Idempotent Docker Engine + Compose Plugin installation for Ubuntu/Debian. Safe to run multiple times.
Scans project directory structure, outputs TYPE, FRAMEWORK, BUILD_CMD, RUN_CMD, PORT. Exit codes: 0 = detected, 1 = unknown.
Reads detection output, selects template, writes Dockerfile. Skips if Dockerfile/docker-compose.yml already exists.
All deploy-agent containers are labeled:
deploy-agent.managed=truedeploy-agent.source=<absolute-source-dir>To clean up all:
docker rm -f $(docker ps -aq --filter "label=deploy-agent.managed=true")
| 权限 | 范围 | 用途 | 说明 |
|---|---|---|---|
| 执行 | sudo | Docker 安装、用户组管理 | bootstrap-docker.sh 安装 Docker |
| 执行 | docker | 容器管理 | 构建、运行、停止容器 |
| 文件系统 | 读取 | 项目目录 | 检测项目类型、读取构建配置 |
| 文件系统 | 写入 | 项目目录 | 生成 Dockerfile |
| 网络 | 出站 | Docker Hub / 镜像源 | 拉取基础镜像 |
| 网络 | 端口绑定 | 宿主机端口 | 容器端口映射,检测可用端口 |
⚠️ 除非使用
install-docker命令,否则不需要 sudo 权限。Docker 操作建议通过docker用户组运行。