Performance: docker-compose for services
MEDIUM IMPACT
This affects the startup time and resource usage of multiple backend services running together, impacting initial load and responsiveness.
version: '3.8' services: service1: build: ./service1 ports: - "8080:8080" service2: build: ./service2 ports: - "8081:8081" depends_on: service1: condition: service_healthy healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health"] interval: 10s retries: 5
version: '3.8' services: service1: build: ./service1 ports: - "8080:8080" service2: build: ./service2 ports: - "8081:8081" depends_on: - service1 command: ./wait-for-it.sh service1:8080 -- java -jar app.jar
| Pattern | Container Startup | Blocking | Resource Usage | Verdict |
|---|---|---|---|---|
| Sequential wait-for-it script | Serial startup | Blocks dependent services | Higher due to idle wait | [X] Bad |
| Healthcheck with depends_on | Parallel startup | Non-blocking | Efficient resource use | [OK] Good |