运维 run 本地
- 作者仓库星标 0
- 作者仓库 skills-registry
Ops: Run Local
Manage the local Docker Compose development environment.
Argument: $ARGUMENTS — start, stop, restart, status, start-app, start-services (default: start)
Prerequisites (run before any operation)
Verify Docker is running:
docker info > /dev/null 2>&1 && echo "Docker OK" || echo "ERROR: Docker is not running — start Docker Desktop"Check port availability:
lsof -i :3000 2>/dev/null | grep LISTEN lsof -i :5432 2>/dev/null | grep LISTENVerify Ruby and Bundler are available:
ruby --version && bundle --version
Discovery
Read the project's docker-compose.yml (or compose.yaml) to identify available services. Common services include:
weborapp— the Rails applicationpostgresordb— PostgreSQL databaseworker— Solid Queue background workercss— Tailwind CSS watch process
Read Procfile.dev if it exists — it defines the local development process manager configuration (typically run via bin/dev).
Read config/database.yml to understand which databases need to exist locally.
Operations
start (full stack)
Start all Docker Compose services and the Rails application.
Start infrastructure services (PostgreSQL, etc.):
docker compose up -d postgresWait for PostgreSQL (up to 30 seconds):
for i in $(seq 1 30); do docker compose exec -T postgres pg_isready -U postgres > /dev/null 2>&1 && echo "PostgreSQL ready" && break sleep 1 doneCreate and migrate databases (if needed):
bin/rails db:prepareStart the full stack via
bin/dev(Procfile.dev) or Docker Compose:# Option A: Procfile.dev (preferred — starts web, worker, CSS watcher) bin/devRun this in the background using the Bash tool with
run_in_background: true.# Option B: Docker Compose (if all services are containerized) docker compose up -dWait for Rails (up to 60 seconds):
for i in $(seq 1 60); do curl -sf http://localhost:3000/up > /dev/null 2>&1 && echo "Rails ready" && break sleep 1 doneReport status table.
start-services (infrastructure only)
Start only infrastructure services (database, cache) without the Rails app.
docker compose up -d postgres
Wait for readiness:
for i in $(seq 1 30); do
docker compose exec -T postgres pg_isready -U postgres > /dev/null 2>&1 && echo "PostgreSQL ready" && break
sleep 1
done
start-app (Rails app only, assumes services are running)
bin/dev
Run in background. Verify:
for i in $(seq 1 60); do
curl -sf http://localhost:3000/up > /dev/null 2>&1 && echo "Rails ready" && break
sleep 1
done
stop
Stop all local services.
# Stop Rails processes (bin/dev uses foreman which spawns child processes)
lsof -ti :3000 | xargs kill -9 2>/dev/null || echo "No Rails process on :3000"
# Stop Docker Compose services
docker compose down
restart
- Run stop (above).
- Wait 2 seconds:
sleep 2 - Run start (above).
- Verify all services respond.
status
Check what is currently running and responsive.
echo "=== Port Check ==="
echo -n "Rails :3000 — "; lsof -i :3000 2>/dev/null | grep LISTEN > /dev/null && echo "LISTENING" || echo "NOT LISTENING"
echo -n "Postgres :5432 — "; lsof -i :5432 2>/dev/null | grep LISTEN > /dev/null && echo "LISTENING" || echo "NOT LISTENING"
echo ""
echo "=== Health Check ==="
echo -n "Rails /up — "; curl -sf -o /dev/null -w "HTTP %{http_code} in %{time_total}s" http://localhost:3000/up 2>/dev/null || echo "UNREACHABLE"
echo ""
echo "=== Docker Compose ==="
docker compose ps 2>/dev/null || echo "No Docker Compose services running"
echo ""
echo "=== Solid Queue Worker ==="
bin/rails runner "puts SolidQueue::Process.where('last_heartbeat_at > ?', 5.minutes.ago).count.to_s + ' active workers'" 2>/dev/null || echo "Cannot query Solid Queue (app may not be running)"
Report results as a table:
| Service | Port | Listening | Responsive |
|---|---|---|---|
| Rails (web) | 3000 | YES/NO | YES/NO |
| PostgreSQL | 5432 | YES/NO | N/A |
| Solid Queue worker | N/A | N/A | YES/NO (heartbeat) |
<!-- tomevault:4.0:skill_md:2026-05-22 -->Source: CodySwannGT/lisa — distributed by TomeVault.
- 流狐分类
- 运维部署
- 作者声明 Agent
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 作者 / 版本 / 许可
- @tomevault-io · 未声明 license
- 流狐 Token 估算
- 低消耗
- 流狐接入估算
- 需手动接入
- 是否需要外部 API Key
- 未发现要求
- 检测到的系统要求
- Docker
- 底层运行要求
- Docker
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 检测到的网络行为
- 允许外网请求
- 安装命令数
- 无(仅作为资料)
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
作者没有在当前 SKILL.md 中定义固定输出样例。 Verify Docker is running: Check port availability: Verify Ruby and Bundler are available:
Read the project's docker-compose.yml (or compose.yaml) to identify available services. Common services include: web or app — the Rails application postgres or db — PostgreSQL database
Operations
Start all Docker Compose services and the Rails application. Start infrastructure services (PostgreSQL, etc.): Wait for PostgreSQL (up to 30 seconds):
Start only infrastructure services (database, cache) without the Rails app. Wait for readiness:
Run in background. Verify:
# Ops: Run Local
Manage the local Docker Compose development environment.
**Argument**: `$ARGUMENTS` — `start`, `stop`, `restart`, `status`, `start-app`, `start-services` (default: `start`)
## Prerequisites (run before any operation)
1. Verify Docker is running:
```bash
docker info > /dev/null 2>&1 && echo "Docker OK" || echo "ERROR: Docker is not running — start Docker Desktop"
```
2. Check port availability:
```bash
lsof -i :3000 2>/dev/null | grep LISTEN
lsof -i :5432 2>/dev/null | grep LISTEN
```
3. Verify Ruby and Bundler are available:
```bash
ruby --version && bundle --version
```
## Discovery
Read the project's `docker-compose.yml` (or `compose.yaml`) to identify available services. Common services include:
- `web` or `app` — the Rails application
- `postgres` or `db` — PostgreSQL database
- `worker` — Solid Queue background worker
- `css` — Tailwind CSS watch process
Read `Procfile.dev` if it exists — it defines the local development process manager configuration (typically run via `bin/dev`).
Read `config/database.yml` to understand which databases need to exist locally.
## Operations
### start (full stack)
Start all Docker Compose services and the Rails application.
1. **Start infrastructure services** (PostgreSQL, etc.):
```bash
docker compose up -d postgres
```
2. **Wait for PostgreSQL** (up to 30 seconds):
```bash
for i in $(seq 1 30); do
docker compose exec -T postgres pg_isready -U postgres > /dev/null 2>&1 && echo "PostgreSQL ready" && break
sleep 1
done
```
3. **Create and migrate databases** (if needed):
```bash
bin/rails db:prepare
```
4. **Start the full stack** via `bin/dev` (Procfile.dev) or Docker Compose:
```bash
… 作者原文负责流程事实;流狐只索引当前章节、要点、文件与命令。
章节 -> Prerequisites (run before any operation) → Discovery → Operations → start (full stack) → start-services (infrastructure only) → start-app (Rails app only, assumes services are running)
要点 -> Argument · Start infrastructure services · Wait for PostgreSQL · Create and migrate databases · Start the full stack · Wait for Rails · stop · start
文件/命令 -> $ARGUMENTS · start · stop · restart · status · start-app · start-services · docker-compose.yml
内容 SHA-256 -> 93e33204e26a
原文结构
适用与边界
原文中的明确线索
$ARGUMENTS、start、stop、restart、status、start-app、start-services、docker-compose.yml