文档

xCloud Docker Deploy

试用

为 xCloud 准备 Docker 项目,改文件前需用户确认,并自动修正端口冲突。

它能做什么

先扫描项目目录识别技术栈(WordPress、Laravel、Next.js、Python、Go 等),再改写 docker-compose.yml、Dockerfile 和 GitHub Actions 工作流,让镜像从公网 registry 推到 xCloud。会修正 host 端口 80/443 映射(如 80:80 → 3080:80),并删除与 xCloud 反向代理冲突的 Caddy/Traefik/nginx-proxy 服务。改文件、生产建议、调用 live xCloud API 都必须在用户明确确认后才执行,涉及 API token 还有独立的二次确认步骤。

什么时候用它

  • 把现有 docker-compose.yml 应用迁移到 xCloud 的 git-push 部署
  • 迁移多服务架构时修复 Caddy / Traefik / 多端口冲突
  • 为 Next.js、Python、Go 项目生成 GHCR 镜像构建工作流
  • 为 monorepo 多服务(前端 + 后端 + worker)生成矩阵构建流程

技能文档

xCloud Docker Deploy v1.4.1

Version ClawHub xCloud API License

Built for xCloud Custom Docker deployments by Asif2BD · GitHub · Latest Release · xCloud Agent Skills

Start Here

This is a deployment-preparation skill. Before it inspects a project, edits files, recommends production changes, asks for API tokens, or routes to live xCloud API skills, the agent must confirm the exact action with the user.

Use this safe opening:

I can do read-only analysis first, or I can generate deployment files after your confirmation. I will not push, deploy, collect tokens, or call live xCloud APIs unless you explicitly approve that exact step.

Use normal human language. Ask:

This is my project. I want to deploy it on xCloud. Please inspect it, decide whether it should use xCloud native deployment or Docker, generate the proper Dockerfile, Docker image workflow, docker-compose.yml, .env.example, and give me the exact xCloud deployment steps.

If you already have a compose file, ask:

Please make this docker-compose.yml work on xCloud. Fix anything xCloud does not support, especially Docker build steps, proxy services, and host ports 80/443.

The agent should then:

  1. Ask whether to perform read-only analysis or generate files.
  2. Detect the stack after the user confirms project inspection.
  3. Choose native xCloud deployment or Custom Docker.
  4. Generate or fix Docker files only after explicit confirmation.
  5. Explain the exact xCloud UI/API steps in simple language.
  6. Before any production-impacting step, recommend a branch, backup, and staging/test deployment.

xCloud port-safety notice: final compose output must never bind host port 80 or 443. If an app listens on container port 80, use 3080:80 and set xCloud's exposed/primary port to 3080.

Adapt any docker-compose.yml to work with xCloud — a git-push Docker deployment platform.

How xCloud Works

git push → xCloud runs: docker-compose pull && docker-compose up -d

xCloud never runs docker build. Images must be pre-built in a public registry. SSL, reverse proxy, and domain routing are handled by xCloud — your stack must not duplicate them.

Read references/xcloud-constraints.md for the full ruleset before making changes.

Current xCloud API + Agent Skills Context

xCloud now publishes API-backed agent skills for operational work:

Official skillOwns
xcloud:serversServers, PHP, databases, cron, firewall/fail2ban, sudo users, WordPress provisioning
xcloud:sitesSite lifecycle, status, backups, domains, cache, SSH, site cron, git
xcloud:wordpressWordPress plugins, themes, updates, debug, magic login, vulnerabilities, PageSpeed
xcloud:sslSSL certificates: view, install, renew, status, delete
xcloud:accountCurrent user, API tokens, Cloudflare integrations, blueprints, health

Use this skill for project detection, Dockerfile/compose generation, GHCR CI, and xCloud Custom Docker readiness. Use the official API skills when the user asks to inspect or mutate live xCloud resources.

API Token Flow

This Docker deploy skill can work alongside the official xCloud API skills when those skills/tools are available. If a task needs live xCloud data or live actions:

  1. Ask whether the user wants live xCloud API help.
  2. State the exact live operation before requesting a token, such as "list servers" or "read deployment logs".
  3. Ask for a least-privilege, short-lived token where possible.
  4. If no token is available, ask the user to provide or configure a private XCLOUD_API_TOKEN.
  5. Never print, store, log, reuse, or commit the token. Use it only for the approved action.
  6. Use the official xCloud API skills for live operations:
    • xcloud:servers for server capacity, PHP, databases, cron, firewall, sudo users, WordPress provisioning
    • xcloud:sites for site status, domains, backups, cache, SSH, git, deployment logs
    • xcloud:wordpress for WordPress plugins, themes, updates, debug, magic login, vulnerabilities, PageSpeed
    • xcloud:ssl for certificates
    • xcloud:account for current user, API tokens, Cloudflare integrations, blueprints, health
  7. Keep Docker generation local and deterministic; use the API only for live xCloud account/server/site actions.

Production Safety Gate

Before recommending git push, deployment webhooks, migration commands, cache clears, DNS changes, SSL changes, or live API actions:

  1. Confirm the target environment: staging or production.
  2. Ask whether a backup exists for production sites/databases.
  3. Prefer a feature branch or pull request for generated files.
  4. Show the generated Dockerfile, compose file, workflow, and environment variable list before the user applies them.
  5. Do not trigger deployment webhooks or live API mutations without a separate final confirmation.

Phase 0 — Detect Project Type First

Before anything else, scan the project directory for these files:

Read DETECT.md for full detection rules. Quick routing:

Found in projectStackAction
wp-config.php or wp-content/WordPressRead references/xcloud-native-wordpress.md
composer.json + artisanLaravelRead references/xcloud-native-laravel.md
package.json + next.config.*Next.jsDocker path → use dockerfiles/nextjs.Dockerfile + compose-templates/nextjs-postgres.yml
package.json (no framework config)Node.jsRead references/xcloud-native-nodejs.md
composer.json (no artisan)PHPRead references/xcloud-native-php.md
requirements.txt or pyproject.tomlPythonDocker path → use dockerfiles/python-fastapi.Dockerfile
go.modGoDocker path — generate Dockerfile manually
docker-compose.yml existsExisting DockerProceed to Step 1 below
Dockerfile (no compose)Build-from-sourceGenerate compose → Scenario A below

See references/xcloud-deploy-paths.md for the Native vs Docker decision guide.


Step 1 — Detect Which Scenarios Apply

Inspect the provided docker-compose.yml:

SignalScenario
build: or build: context: .A — Build-from-source
Caddy / Traefik / nginx-proxy serviceB — Proxy conflict
Multiple ports: across servicesB — Multi-port
Host port 80 or 443 in any ports: mappingB — xCloud reserved port conflict
./nginx.conf:/etc/nginx/... volume mountB — External config
Multiple services each with build:C — Multi-service build
image: some-public-image, single portAlready compatible — verify port + env vars

A compose file can trigger multiple scenarios simultaneously (handle A first, then B).


Scenario A — Build-from-Source

Read references/scenario-build-source.md for full details.

What to do:

  1. Remove build: directive from compose
  2. Replace image: with ghcr.io/OWNER/REPO:latest
  3. Generate .github/workflows/docker-build.yml using assets/github-actions-build.yml template
  4. Generate .env.example from all ${VAR} references

Deliverables:

  • Modified docker-compose.yml
  • .github/workflows/docker-build.yml
  • .env.example
  • xCloud Deploy Steps (see Output Format)

Scenario B — Proxy Conflict / Multi-Port / External Config

Read references/scenario-proxy-conflict.md for full details.

What to do:

  1. Remove Caddy/Traefik/nginx-proxy service entirely
  2. Remove SSL labels and multi-port ports: from app services (replace with expose:)
  3. Add nginx-router service with inline config via configs: block
  4. Expose single port (default: 3080) for xCloud to proxy

Deliverables:

  • Modified docker-compose.yml with nginx-router + configs: block
  • .env.example
  • xCloud Deploy Steps

Scenario C — Multi-Service Build

Read references/scenario-multi-service-build.md for full details.

When multiple services have build: directives (separate frontend + backend + worker):

What to do:

  1. For each service with build:, create a separate GHCR image path
  2. Generate a matrix GitHub Actions workflow that builds all images in parallel
  3. Update compose to use all GHCR image references

Deliverables:

  • Modified docker-compose.yml (all build: removed)
  • .github/workflows/docker-build.yml (matrix strategy)
  • .env.example

Output Format

Always produce complete, copy-paste-ready output:

## Modified docker-compose.yml
[full file]

## .github/workflows/docker-build.yml  (Scenario A/C only)
[full file]

## .env.example
[full file]

## xCloud Deploy Steps
1. Push repo to GitHub
2. (Scenario A/C) Wait for GitHub Actions to build image — check Actions tab
3. Server → New Site → Custom Docker → connect repo
4. Exposed port: [PORT]
5. Env vars to add: [list from .env.example]
6. Deploy

Rules

  • Never include build: in the final compose — xCloud silently ignores it
  • Never bind host port 80 or 443 in final compose — xCloud's Nginx/SSL layer already owns them
  • If the app listens on container port 80, output 3080:80 and tell xCloud to use exposed/primary port 3080
  • If you see 80:80, treat it as invalid for xCloud and rewrite it to 3080:80
  • Never expose database ports to host (remove "5432:5432" — use expose: internally)
  • Never include Caddy, Traefik, nginx-proxy, or Let's Encrypt config
  • Always preserve environment:, volumes:, healthcheck:, worker/sidecar services
  • Always use expose: (internal) not ports: (host) for services behind nginx-router
  • Always report the xCloud exposed/primary port as the host-side port from the single allowed web mapping
  • WebSockets? Add upgrade headers to nginx config (see proxy-conflict reference)
  • configs.content: inline syntax requires Docker Compose v2.23+ — use heredoc command: alternative if uncertain

Port Normalization

xCloud receives public traffic on 80/443 through its own Nginx and SSL layer. Docker compose should expose one high host port for xCloud to proxy into:

User → xCloud Nginx 80/443 → Docker host port >=1024 → container port

Normalize ports before final output:

Original mappingFinal xCloud mappingxCloud exposed/primary port
80:803080:803080
443:443removen/a
8080:80prefer 3080:80 unless user explicitly requires 80803080
3000:3000allowed3000
8000:8000allowed8000

Final validation: no ports: mapping may start with 80: or 443:.


Examples

See examples/ for ready-made transformations:

  • examples/rybbit-analytics.md — Caddy + multi-port app (Scenario B)
  • examples/custom-app-dockerfile.md — build-from-source (Scenario A)
  • examples/fullstack-monorepo.md — multi-service build (Scenario C)

常见问题

它会不问就直接改文件或部署吗?
不会。任何检查、改文件、生产建议、索取 API token,都必须经用户明确确认后才执行;影响生产的操作还会有单独的最后确认环节。
它会在 xCloud 服务器上执行 docker build 吗?
不会。xCloud 不执行 docker build。该技能生成 GitHub Actions 工作流先把镜像推到 GHCR,xCloud 再通过 docker-compose up 拉取运行。
它能直接操作线上 xCloud 资源吗?
可以,但只能通过官方 xcloud:* API 技能(servers / sites / wordpress / ssl / account),并且需要用户单独确认并提供最小权限的短期 token。

相关技能

把自然语言描述转为结构化 JSON,并由 mcp-diagram-generator MCP 服务生成 Draw.io、Mermaid 或 Excalidraw 图表文件。

作者 nssa.io1.0k 次安装47 星标

在本地磁盘以分类纯 Markdown 文件保存需要长期留存的事实,与智能体内置记忆并存。

作者 Iván559 次安装18 星标

诊断生产力系统反复失效的根因,给出最小干预——容量测算、瓶颈定位、可靠的本地记录。

作者 Iván855 次安装69 星标

以 AI 机器人身份加入视频会议,提供语音、虚拟形象与屏幕共享四种模式。

作者 johnpatternai22 次安装8 星标

执行 Git 操作(提交、分支、合并、变基、冲突解决与恢复)时强制套用安全规则。

作者 Iván535 次安装31 星标

asif2bd 的更多技能

浏览全部技能

为 OpenClaw 代理减少重复性的 token 消耗:按需加载上下文、Sonnet/Opus 分流、缓存感知的 heartbeat 调度。

作者 asif2bd467 次安装30 星标

Publish content directly to WordPress sites via REST API with full Gutenberg block support. Create and publish posts/pages, auto-load and select categories from website, generate SEO-optimized tags, preview articles before publishing, and generate Gutenberg blocks for tables, images, lists, and rich formatting. Use when user wants to publish to WordPress, post to blog, create WordPress article, update WordPress post, or convert markdown to Gutenberg blocks.

作者 asif2bd189 次安装10 星标

Universal travel planning skill for OpenClaw agents. Plan itineraries, check weather, discover attractions, and estimate budgets — all through natural conver...

作者 asif2bd33 次安装

Install, authenticate, and use Claude Code CLI as a native coding tool for any OpenClaw agent system.

作者 asif2bd32 次安装

Dramatically reduce per-session token usage by loading skills and context files only when needed — not at session start. Includes the SKILLS catalog pattern,...

作者 asif2bd36 次安装