speckit.devopslisted
Install: claude install-skill wedabro/bro-skills
## 🎯 Mission
Set up and manage a standardized and secure Docker system for the project.
Published ports MUST always be configured via environment variables.
## 📥 Input
- `.agent/memory/constitution.md` (port range, security rules)
- Existing `Dockerfile` , `docker-compose.yml` (if available)
- `.env.example`
## 📋 Protocol
### 1. Port Allocation (ENV-first) ⭐
**ALWAYS configure ports via ENV:**
- `.env` file (local) or server ENV (production)
- `docker-compose.yml` reads: `"${PUBLIC_PORT}:${WEB_CONTAINER_PORT}"`
- Document required port variables in `.env.example`; do not hide missing
configuration behind a fixed fallback.
- **CRITICAL**: If `.env` or system environment already has port variables defined (e.g. `PUBLIC_PORT`, `ADMIN_PORT`, `API_PORT` or equivalents), **ABSOLUTELY SKIP** port scanning/assignment and **NEVER** overwrite the existing port configuration.
**Port scanning rules according to environment:**
| Environment | Existing Ports in .env? | Docker running? | Act |
|---|---|---|---|
| **Any** | ✅ Yes | Any | **SKIP** scan — use existing ports, **DO NOT** overwrite |
| **Local** | ❌ No | ❌ No (first time) | Scan available ports with socket/helper → select 3 consecutive empty ports |
| **Local** | ❌ No | ✅ Already running | **SKIP** scan — use current ports from docker/containers |
| **Staging/Beta/Prod** | ❌ No | Any | **ALWAYS** initial scan for configuration → write to `.env` |
**Check Docker is running (Local):**
```bash
docker compose ps --format