Recommended Docker Compose service field-order
Recommended sequence (most common in official Compose examples and production teams):
- image / build → What the service is
- command → How it runs (if overridden)
- ports → External access (if any)
- volumes → Data persistence
- environment → Configuration
- depends_on / links / networks → Dependencies and networking
- healthcheck → Readiness/liveness probes
- restart → Restart policy (if used)