Container to wait for container healthchecks before proceeding with the stack start
Available for linux/amd64
and linux/arm64
architectures.
- TCP connectivity: Wait for services to be accessible via TCP (using
host:port
format) - Shell command: Execute arbitrary shell commands and wait for successful completion
- Configurable timeouts: Customizable sleep intervals and timeout periods
- User-friendly output: Clear progress indicators and status messages
- Multi-architecture support: Available for
linux/amd64
andlinux/arm64
Wait for services to accept TCP connections on specific ports:
services:
database:
image: postgres:15-alpine
environment:
POSTGRES_PASSWORD: secret
ports:
- "5432:5432"
cache:
image: redis:7-alpine
ports:
- "6379:6379"
app:
image: alpine:3.22
depends_on:
# Will start only after the wait-for-dependencies finishes waiting
# for both database and cache to be reachable.
wait-for-dependencies:
condition: service_completed_successfully
ports:
- "8000:8000"
wait-for-dependencies:
image: drevops/docker-wait-for-dependencies:25.9.0
depends_on:
- database
- cache
command: database:5432 cache:6379
Wait for both TCP connectivity and custom health check endpoints:
services:
api:
image: php:8.3-cli-alpine
ports:
- "8080:8080"
command: php -S 0.0.0.0:8080 -t /app
worker:
image: alpine:3.18
ports:
- "9000:9000"
command: nc -l -p 9000
app:
image: alpine:3.22
depends_on:
# Will start only after the wait-for-dependencies finishes waiting
# for both api and worker to be reachable.
wait-for-dependencies:
condition: service_completed_successfully
ports:
- "8000:8000"
wait-for-dependencies:
image: drevops/docker-wait-for-dependencies:25.9.0
depends_on:
- api
- worker
command:
- api:8080
- worker:9000
- "curl -f http://api:8080/health"
- "test -S /var/run/app.sock"
The container supports the following environment variables:
Variable | Default | Description |
---|---|---|
SLEEP_LENGTH |
2 |
Time (in seconds) to wait between each check attempt |
TIMEOUT_LENGTH |
300 |
Maximum time (in seconds) to wait before giving up |
SUMMARY_ENABLED |
true |
Show summary message when all checks complete successfully |
npm run lint # Lint shell scripts and Dockerfile
npm run lint-fix # Auto-fix formatting issues
npm run test-unit # Run unit tests for validation logic
npm run test-functional # Run end-to-end tests with Docker
This project uses CalVer versioning:
YY
: Last two digits of the year, e.g.,25
for 2025.m
: Numeric month, e.g., April is4
.patch
: Patch number for the month, starting at0
.
Example: 25.4.2
indicates the third patch in April 2025.
Releases are scheduled to occur at a minimum of once per month.
The cross-platform images are built by GitHub actions and pushed to DockerHub:
YY.m.patch
tag - when release tag is published on GitHub.latest
- when release tag is published on GitHub.canary
- on every push tomain
branch
Renovate bot is used to update dependencies. It creates a PR with the changes
and automatically merges it if CI passes. These changes are then released as
a canary
version.
This repository was created using the Scaffold project template