dykyi-roman/awesome-claude-code/optimize-docker-startup
- community
Checking that the SKILL.md file is still in the repository.
Optimizes Docker container startup time for PHP applications. Reduces initialization overhead through preloading, caching, and entrypoint optimization.
Install
npx vskill@latest install dykyi-roman/awesome-claude-code/optimize-docker-startupSKILL.md
Docker Container Startup Optimization
Reduces cold start and initialization time for PHP applications in Docker containers.
Startup Time Breakdown
OPcache Preloading for Startup
Preload Strategy
Impact: Eliminates 200-500ms first-request compilation latency.
Composer Autoloader Optimization
| Mode | Startup | Runtime | Use Case | |
|---|---|---|---|---|
| Default (PSR-4) | Fast | Slow (file scan) | Development | |
| --optimize | Medium | Fast (classmap + PSR-4 fallback) | Staging | |
| --classmap-authoritative | Slow (once) | Fastest (classmap only) | Production |
Impact: Reduces autoload time by 60-80% on each request.
Framework Cache Warmup
Symfony
Laravel
| Command | What It Caches | Time Saved | |
|---|---|---|---|
| config:cache | All config files into single file | 50-100ms | |
| route:cache | Route registrations | 100-300ms | |
| view:cache | Blade template compilation | 50-200ms | |
| event:cache | Event-listener mappings | 20-50ms |
Impact: Eliminates 300-600ms of startup/first-request overhead.
Entrypoint Optimization
Anti-Pattern: Sequential Blocking Entrypoint
Optimized: Parallel and Background Tasks
Impact: Reduces startup from 15s to 3-5s by parallelizing non-critical init.
Wait-for-It Pattern
Health Check Configuration
start_period Tuning
| Parameter | Purpose | Recommendation | |
|---|---|---|---|
| start_period | Grace period before health checks count | Set to expected startup time | |
| interval | Time between checks | 10-30s (lower = faster detection) | |
| timeout | Max wait for check response | 3-5s | |
| retries | Failures before unhealthy | 2-3 |
Lightweight Health Check
Lazy Service Initialization
Symfony Lazy Services
Laravel Deferred Providers
Impact: Reduces container bootstrap by 100-500ms per heavy service.
Build-Time vs Runtime Init
| Task | Build Time | Runtime | Recommendation | |
|---|---|---|---|---|
| Composer install | Yes | No | Build only | |
| Autoloader optimize | Yes | No | Build only | |
| Config cache | Yes | No | Build only | |
| Route cache | Yes | No | Build only | |
| View cache | Yes | No | Build only | |
| Migrations | No | Yes (background) | Background at startup | |
| DB connection check | No | Yes (background) | Background at startup | |
| Cache warmup | Yes | Verify only | Build, verify at startup | |
| OPcache preload | No | Yes (automatic) | PHP-FPM handles it |
Optimized Dockerfile Pattern
Before/After Startup Time Comparison
| Phase | Before | After | Technique | |
|---|---|---|---|---|
| Entrypoint script | 3.0s | 0.5s | Parallel, background tasks | |
| Migration check | 2.0s | 0s (background) | Non-blocking | |
| Cache warmup | 4.0s | 0.2s (verify only) | Build-time warmup | |
| OPcache preload | 2.0s | 2.0s | Unavoidable, but worth it | |
| PHP-FPM start | 1.0s | 1.0s | Minimal improvement | |
| Health check pass | 2.5s | 1.0s | Lightweight check + start_period | |
| Total | ~15s | ~5s | -67% |
Generation Instructions
- Audit current startup: Measure time from container start to first healthy response
- Move to build time: Config cache, route cache, autoloader optimization
- Optimize entrypoint: Parallelize, background non-critical tasks
- Configure preloading: Preload domain and framework hot-path classes
- Tune health checks: Set appropriate start_period and use lightweight checks
- Defer heavy services: Use lazy proxies for services not needed immediately
- Measure improvement: Compare container ready time before and after
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/optimize-docker-startup/SKILL.md
Popularity
- Repository stars
- 96
- Repository forks
- 25
- 7-day trend score
- 23
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 18 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/dykyi-roman/awesome-claude-code/optimize-docker-startup)