ae39e45460
NOVAS SKILLS: - next-best-practices v0.1.0 (CLEAN) — Next.js App Router, RSC, caching, data - nextjs-patterns v1.0.0 (CLEAN) — Next.js 15: Server Actions, route handlers - vite v1.0.0 (CLEAN) — env vars, aliases, proxy, CJS compat - uncle-bob v1.0.0 (CLEAN) — Clean Code, SOLID, Clean Architecture - clean-code-review v1.0.0 (CLEAN) — naming, guard clauses, anti-patterns, refactoring - vue v1.0.0 (CLEAN) — Vue framework - vue-composition-api-best-practices v1.0.0 (CLEAN) — composables, Pinia, reactivity BIBLIOTECA INTELIGENTE libs/ (10 dominios, 11 arquivos): - typescript/ — TS safe + generics gotchas - react/ — Next.js App Router + Vite config - vue/ — Composition API + Pinia - linux/ — System diagnostic cheatsheet - database/ — PostgreSQL + MySQL patterns - browser/ — Chromium CLI + E2E testing - security/ — SAST audit (OWASP Top 10) - best-practices/ — Clean Code + SOLID + Clean Architecture - deploy/ — Docker multi-stack + OpenClaw ops - + INDEX.md como guia de navegacao .learnings/ — LRN-20260519-003 criado (biblioteca compartilhada)
2.7 KiB
2.7 KiB
Docker — Multi-Stack Deploy
Extraído de
xcloud-docker-deployv1.2.1 + habilidades de openclaw-power-ops
🗺️ Stack Detection Router
| Arquivo encontrado | Stack | Ação |
|---|---|---|
wp-config.php ou wp-content/ |
WordPress | Ver ref xcloud-native-wordpress.md |
composer.json + artisan |
Laravel | Ver ref xcloud-native-laravel.md |
package.json + next.config.* |
Next.js | Usar dockerfiles/nextjs.Dockerfile |
package.json |
Node.js | Ver ref xcloud-native-nodejs.md |
composer.json (sem artisan) |
PHP | Ver ref xcloud-native-php.md |
requirements.txt ou pyproject.toml |
Python | Usar dockerfiles/python-fastapi.Dockerfile |
go.mod |
Go | Gerar Dockerfile manualmente |
docker-compose.yml existe |
Docker existente | Prosseguir Step 1 |
Step 1 — Cenário Detection
| Sinal | Cenário |
|---|---|
build: ou context: . |
A — Build-from-source |
| Caddy/Traefik/nginx-proxy | B — Proxy conflict |
Múltiplos ports: por service |
B — Multi-port |
./nginx.conf volume mount |
B — External config |
Múltiplos services com build: |
C — Multi-service build |
image: public-image, 1 porta |
✅ Já compatível |
Cenário A — Build-from-Source
- Remover
build:do compose - Trocar
image:porghcr.io/OWNER/REPO:latest - Gerar
.github/workflows/docker-build.yml - Gerar
.env.example
Cenário B — Proxy Conflict
- Remover Caddy/Traefik/nginx-proxy service
- Remover SSL labels e multi-port — usar
expose:(interno) - Adicionar
nginx-routerservice comconfigs:inline - Expor uma porta (default: 3080)
Cenário C — Multi-Service Build
- Matrix GitHub Actions — cada service com
build:vira um GHCR image - Compose atualizado com todas as imagens GHCR
🚨 Regras de Ouro (xCloud)
- ❌ Nunca incluir
build:no compose final — xCloud ignora silenciosamente - ❌ Nunca expor portas de DB diretas (
5432:5432) — usarexpose: - ❌ Nunca incluir Caddy, Traefik, nginx-proxy, Let's Encrypt
- ✅ Preservar
environment:,volumes:,healthcheck: - ✅ Sempre usar
expose:(interno), nãoports:(para serviços internos)
Dockerfiles Disponíveis
| Stack | Dockerfile |
|---|---|
| PHP genérico | dockerfiles/php-generic.Dockerfile |
| Laravel | dockerfiles/laravel.Dockerfile |
| Node.js | dockerfiles/node-app.Dockerfile |
| Next.js | dockerfiles/nextjs.Dockerfile |
| Python FastAPI | dockerfiles/python-fastapi.Dockerfile |
Compose Templates
compose-templates/laravel-mysql.ymlcompose-templates/nextjs-postgres.ymlcompose-templates/nodejs-api-postgres.ymlcompose-templates/python-fastapi-postgres.yml