Docker check
Verify docker-compose.yml, Dockerfile, and .env are properly synchronized.From its SKILL.md
npx -y skills add edulazaro/laraclaude --skill docker-checkAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 12 stars12 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
7.0 KB, as published. Nobody here has run it
Docker Configuration Check
Verify that docker-compose.yml, Dockerfile, .env, and composer.json are properly synchronized. Detects mismatched service names, port conflicts, missing extensions, and configuration drift.
Subcommands
| Subcommand | Description |
|---|---|
| (no argument) | Analyze Docker configuration and report issues. Read-only. |
fix | Fix detected mismatches by syncing .env with docker-compose values. Asks for confirmation before each change. |
fix --dry-run | Show what .env changes would be made without modifying anything. |
Process
Step 1: Read Configuration Files
Use Read to load:
docker-compose.yml(ordocker-compose.yaml,compose.yml,compose.yaml)Dockerfile(and any variant likedocker/*/Dockerfile,docker/Dockerfile).env.env.examplecomposer.json(for PHP version and extension requirements)
If any file is missing, note it and continue with available files.
Step 2: Check Service-to-Env Synchronization
Database Configuration
- Find the database service in docker-compose (mysql, mariadb, postgres).
- Extract:
- Service name (used as hostname): e.g.,
mysql,db,database - Port mapping: e.g.,
3306:3306 - Environment variables:
MYSQL_DATABASE,MYSQL_USER,MYSQL_PASSWORD,MYSQL_ROOT_PASSWORD
- Service name (used as hostname): e.g.,
- Compare with
.env:DB_HOSTshould match the service name (e.g.,mysql, not127.0.0.1)DB_PORTshould match the internal port (usually3306)DB_DATABASEshould matchMYSQL_DATABASEDB_USERNAMEshould matchMYSQL_USERDB_PASSWORDshould matchMYSQL_PASSWORD
Common issue: DB_HOST=127.0.0.1 when it should be the Docker service name (e.g., mysql).
Redis Configuration
- Find the Redis service in docker-compose.
- Compare with
.env:REDIS_HOSTshould match the service name (e.g.,redis)REDIS_PORTshould match the internal port (usually6379)
Mail Configuration
- Find mail services (mailhog, mailpit, mailtrap).
- Compare with
.env:MAIL_HOSTshould match the service nameMAIL_PORTshould match the internal port
Queue/Cache
- Check
CACHE_DRIVERandQUEUE_CONNECTIONin.env. - If set to
redis, verify Redis service exists in docker-compose. - If set to
database, no extra service needed.
Step 3: Check Port Conflicts
- Extract all port mappings from docker-compose:
host_port:container_port. - Check for duplicate host ports (would cause bind errors).
- Check for common conflicts:
3306(MySQL) -- conflicts with local MySQL5432(PostgreSQL) -- conflicts with local PostgreSQL6379(Redis) -- conflicts with local Redis80/443(HTTP/S) -- conflicts with local web server8080(common dev port) -- conflicts with other dev servers
Step 4: Check Volume Paths
- Extract volume mounts from docker-compose.
- For bind mounts (host path : container path):
- Check that the host path exists or is a relative path from the project root.
- Check that the container path makes sense for the service type.
- For named volumes, ensure they are defined in the
volumes:section.
Step 5: Check PHP Version Consistency
- Extract PHP version from Dockerfile (
FROM php:X.Y-fpm,FROM php:X.Y-cli, etc.). - Check
composer.jsonfor therequire.phpconstraint (e.g.,"^8.2"). - Compare: the Dockerfile PHP version should satisfy the Composer constraint.
- If there is a mismatch, flag it.
Step 6: Check Required PHP Extensions
- Parse
composer.jsonforrequireentries starting withext-:"ext-gd": "*"-> requiresgdextension"ext-redis": "*"-> requiresredisextension"ext-intl": "*"-> requiresintlextension
- Parse the Dockerfile for installed extensions:
docker-php-ext-install gd intl pdo_mysqlpecl install redisRUN apt-get install(for underlying libraries)
- Flag extensions required by Composer but not installed in Dockerfile.
Step 7: Check .env.example Completeness
- Compare all keys in
.envwith keys in.env.example. - Flag keys present in
.envbut missing from.env.example(may cause setup issues for new developers). - Flag keys in
.env.examplebut missing from.env(may indicate unused configuration).
Step 8: Report
DOCKER CONFIGURATION CHECK
============================
ISSUES FOUND
--------------
1. DB_HOST mismatch
.env: DB_HOST=127.0.0.1
docker-compose: Database service name is 'mysql'
Fix: Change DB_HOST to 'mysql' in .env
Severity: Critical (app cannot connect to DB in Docker)
2. Port conflict
Service 'mysql' maps to host port 3306
Service 'testing-db' also maps to host port 3306
Fix: Change one service to a different host port (e.g., 3307:3306)
Severity: Critical (docker-compose will fail to start)
3. Missing PHP extension
composer.json requires: ext-redis
Dockerfile: redis extension not found
Fix: Add 'pecl install redis && docker-php-ext-enable redis' to Dockerfile
Severity: High (application will fail at runtime)
4. PHP version mismatch
Dockerfile: PHP {detected_version}
composer.json: "php": "{composer_constraint}"
Status: Compatible/Incompatible
5. Missing .env.example keys
Keys in .env but not in .env.example:
- GOOGLE_OAUTH_CLIENT_ID
- GOOGLE_OAUTH_CLIENT_SECRET
- MICROSOFT_OAUTH_CLIENT_ID
Severity: Low (documentation issue)
ALL CHECKS
-----------
[PASS] Database service exists and is properly configured
[FAIL] DB_HOST does not match service name
[PASS] Redis service exists and matches REDIS_HOST
[PASS] No port conflicts detected
[PASS] Volume paths are valid
[PASS] PHP version is compatible
[FAIL] Missing ext-redis in Dockerfile
[WARN] 3 .env keys missing from .env.example
SUMMARY
========
Checks performed: 8
Passed: 5
Failed: 2
Warnings: 1
Fix Mode
In fix mode, apply corrections with confirmation:
- Sync .env values: Update
DB_HOST,REDIS_HOST,MAIL_HOSTto match docker-compose service names. - Sync credentials: Update
DB_DATABASE,DB_USERNAME,DB_PASSWORDto match docker-compose environment variables. - Update .env.example: Add missing keys with placeholder values.
Not auto-fixed (manual intervention needed):
- Dockerfile changes (adding extensions, changing PHP version)
- Port conflict resolution (requires understanding of the developer's environment)
- Volume path fixes
Notes
- This skill reads configuration files only. It does not start, stop, or modify Docker containers.
- Docker Compose file format (version 2 vs 3) affects syntax. Handle both formats.
- Some projects use multiple Dockerfiles (e.g.,
docker/{version}/Dockerfilefor different PHP versions). Check all. .envfiles may have platform-specific line endings. Handle both\nand\r\n.- When fixing
.env, preserve the existing file format and ordering.