mirror of
https://github.com/docker/compose.git
synced 2026-11-17 13:45:39 +00:00
Most e2e coverage of the start phase runs detached; the foreground `up`, whose create and start phases are driven by separate code paths, had none for hooks, health-gated dependencies, a container that exits as soon as it starts, restarts of exited containers, recreation, dependency timeouts or dry-run. Add scenarios that fix these observables before the machinery behind it changes. Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
22 lines
508 B
YAML
22 lines
508 B
YAML
services:
|
|
db:
|
|
image: alpine
|
|
command: sh -c 'sleep 3; touch /shared/ready; sleep 60'
|
|
init: true
|
|
volumes:
|
|
- shared:/shared
|
|
healthcheck:
|
|
test: ["CMD", "test", "-f", "/shared/ready"]
|
|
interval: 1s
|
|
timeout: 1s
|
|
retries: 30
|
|
web:
|
|
image: alpine
|
|
command: sh -c 'if [ -f /shared/ready ]; then echo web-saw-ready; else echo web-too-early; fi'
|
|
volumes:
|
|
- shared:/shared
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
volumes:
|
|
shared:
|