Check and manage .env configuration for docker-local projects - conflict detection, unique IDs, isolation settings
Manages Docker-local environment configurations by checking for conflicts, generating unique isolation IDs, and updating .env files. Used when verifying project setups, detecting overlapping Redis DBs or cache prefixes, or creating new configurations for multiple local projects.
/plugin marketplace add mwguerra/claude-code-plugins/plugin install docker-local@mwguerra-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
This skill manages .env configuration for docker-local projects:
Before ANY docker-local command, verify installation:
which docker-local > /dev/null 2>&1
If docker-local is NOT found:
composer global require mwguerra/docker-localexport PATH="$HOME/.composer/vendor/bin:$PATH"docker-local initwhich docker-local && docker-local --versionDocker-local uses two separate .env files:
| File | Purpose | Location |
|---|---|---|
| Docker .env | Container configuration | ~/.config/docker-local/.env |
| Laravel .env | Application settings | ~/projects/<project>/.env |
Controls how containers are built:
PROJECTS_PATH=~/projects
MYSQL_PORT=3306
MYSQL_ROOT_PASSWORD=secret
XDEBUG_ENABLED=true
Controls how Laravel connects to services:
DB_HOST=mysql # Docker service name
DB_PORT=3306
REDIS_HOST=redis
MAIL_HOST=mailpit
Key insight: Services have different addresses:
localhost:3306mysql:3306# Verify .env configuration
docker-local env:check
# Checks:
# - Service hostnames (mysql vs localhost)
# - Required variables present
# - Redis DB numbers
# - Cache prefix
# Check ALL projects for conflicts
docker-local env:check --all
# Detects:
# - Duplicate database names
# - Overlapping Redis DBs
# - Duplicate cache prefixes
# - Shared MinIO buckets
# Create new .env with unique IDs
docker-local make:env
# Generates:
# - Unique CACHE_PREFIX
# - Available REDIS_*_DB numbers
# - Unique REVERB credentials
# - Correct service hostnames
# Update .env with current settings
docker-local update:env
# Preserves:
# - Custom settings
# - API keys
# - User modifications
Each project gets its own database:
DB_DATABASE=myapp # Main database
# Also created: myapp_testing
Each project uses 3 Redis databases:
REDIS_CACHE_DB=0
REDIS_SESSION_DB=1
REDIS_QUEUE_DB=2
Allocation pattern:
| Project # | Cache | Session | Queue |
|---|---|---|---|
| 1 | 0 | 1 | 2 |
| 2 | 3 | 4 | 5 |
| 3 | 6 | 7 | 8 |
| 4 | 9 | 10 | 11 |
| 5 | 12 | 13 | 14 |
CACHE_PREFIX=myapp_
Prevents cache key collisions between projects.
AWS_BUCKET=myapp
Each project gets its own S3 bucket.
REVERB_APP_ID=123456
REVERB_APP_KEY=random-key
REVERB_APP_SECRET=random-secret
Each project gets unique WebSocket credentials.
┌─ Environment Check: ~/projects/shop ─────────────────────────────┐
✓ Database Configuration
DB_HOST: mysql (correct)
DB_DATABASE: shop
✓ Redis Configuration
CACHE_DB: 6
SESSION_DB: 7
QUEUE_DB: 8
⚠ CACHE_PREFIX Conflict
Current: laravel_cache_
Conflicts with: blog, api
Fix: Change to 'shop_' in .env:
CACHE_PREFIX=shop_
✓ MinIO Configuration
Bucket: shop
└──────────────────────────────────────────────────────────────────┘
⚠ CACHE_PREFIX conflict with 'other-project'
Both use: laravel_cache_
Why: Cache data shared/corrupted between projects
Fix: CACHE_PREFIX=unique_project_name_
⚠ REDIS_CACHE_DB conflict
Both projects use DB 0
Why: Cache data mixed between projects
Fix: Use next available set (3, 4, 5)
⚠ DB_DATABASE conflict
Both projects use: laravel
Why: Data will be shared/overwritten
Fix: Use unique database name per project
APP_NAME=MyApp
APP_KEY=base64:...
APP_ENV=local
APP_DEBUG=true
APP_URL=https://myapp.test
DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=myapp
DB_USERNAME=laravel
DB_PASSWORD=secret
DB_CONNECTION=pgsql
DB_HOST=postgres
DB_PORT=5432
DB_DATABASE=myapp
DB_USERNAME=laravel
DB_PASSWORD=secret
REDIS_HOST=redis
REDIS_PASSWORD=null
REDIS_PORT=6379
REDIS_CACHE_DB=0
REDIS_SESSION_DB=1
REDIS_QUEUE_DB=2
CACHE_DRIVER=redis
CACHE_PREFIX=myapp_
MAIL_MAILER=smtp
MAIL_HOST=mailpit
MAIL_PORT=1025
FILESYSTEM_DISK=s3
AWS_ENDPOINT=http://minio:9000
AWS_ACCESS_KEY_ID=minio
AWS_SECRET_ACCESS_KEY=minio123
AWS_BUCKET=myapp
AWS_USE_PATH_STYLE_ENDPOINT=true
# Wrong (from host perspective)
DB_HOST=localhost
# Correct (from container)
DB_HOST=mysql
# Generate everything
docker-local make:env
# Or manually:
CACHE_PREFIX=myapp_
REDIS_CACHE_DB=3
REDIS_SESSION_DB=4
REDIS_QUEUE_DB=5
# Backup current .env
cp .env .env.backup
# Generate fresh .env
docker-local make:env
# Restore custom settings
# Manually copy API keys, etc. from backup
$ARGUMENTS
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.