{"id":19140259,"url":"https://github.com/drevops/docker-wait-for-dependencies","last_synced_at":"2026-01-07T08:13:02.437Z","repository":{"id":200236317,"uuid":"705099327","full_name":"drevops/docker-wait-for-dependencies","owner":"drevops","description":"⏳ Docker container that puts itself on hold until the other services are accessible via TCP","archived":false,"fork":false,"pushed_at":"2025-08-11T18:54:18.000Z","size":106,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-06T09:54:32.687Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drevops.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"drevops","patreon":"drevops"}},"created_at":"2023-10-15T02:36:26.000Z","updated_at":"2025-08-11T18:54:21.000Z","dependencies_parsed_at":"2023-12-18T05:42:51.822Z","dependency_job_id":"dcb9e7b2-905e-48fd-a3de-14789347a587","html_url":"https://github.com/drevops/docker-wait-for-dependencies","commit_stats":null,"previous_names":["drevops/docker-wait-for-dependencies"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/drevops/docker-wait-for-dependencies","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drevops%2Fdocker-wait-for-dependencies","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drevops%2Fdocker-wait-for-dependencies/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drevops%2Fdocker-wait-for-dependencies/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drevops%2Fdocker-wait-for-dependencies/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drevops","download_url":"https://codeload.github.com/drevops/docker-wait-for-dependencies/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drevops%2Fdocker-wait-for-dependencies/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274231465,"owners_count":25245625,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T07:16:57.325Z","updated_at":"2026-01-07T08:13:02.432Z","avatar_url":"https://github.com/drevops.png","language":"Shell","funding_links":["https://github.com/sponsors/drevops","https://patreon.com/drevops"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"\" rel=\"noopener\"\u003e\n  \u003cimg width=150px height=150px src=\"logo.png\" alt=\"Wait for dependencies logo\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eDocker wait for dependencies\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![GitHub Issues](https://img.shields.io/github/issues/DrevOps/docker-wait-for-dependencies.svg)](https://github.com/DrevOps/docker-wait-for-dependencies/issues)\n[![GitHub Pull Requests](https://img.shields.io/github/issues-pr/DrevOps/docker-wait-for-dependencies.svg)](https://github.com/DrevOps/docker-wait-for-dependencies/pulls)\n[![Test](https://github.com/drevops/docker-wait-for-dependencies/actions/workflows/test.yml/badge.svg)](https://github.com/drevops/docker-wait-for-dependencies/actions/workflows/test.yml)\n[![codecov](https://codecov.io/gh/drevops/docker-wait-for-dependencies/graph/badge.svg?token=BZK6852630)](https://codecov.io/gh/drevops/docker-wait-for-dependencies)\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/DrevOps/docker-wait-for-dependencies)\n![LICENSE](https://img.shields.io/github/license/DrevOps/docker-wait-for-dependencies)\n![Renovate](https://img.shields.io/badge/renovate-enabled-green?logo=renovatebot)\n\n[![Docker Pulls](https://img.shields.io/docker/pulls/drevops/docker-wait-for-dependencies?logo=docker)](https://hub.docker.com/r/drevops/docker-wait-for-dependencies)\n![amd64](https://img.shields.io/badge/arch-linux%2Famd64-brightgreen)\n![arm64](https://img.shields.io/badge/arch-linux%2Farm64-brightgreen)\n\n\u003c/div\u003e\n\n---\n\n\u003cp align=\"center\"\u003e\n  Container to wait for container healthchecks before proceeding with the stack start\n  \u003cbr\u003e\n  Available for \u003ccode\u003elinux/amd64\u003c/code\u003e and \u003ccode\u003elinux/arm64\u003c/code\u003e architectures.\n  \u003cbr\u003e\n\u003c/p\u003e\n\n## Features\n\n- **TCP connectivity**: Wait for services to be accessible via TCP (using\n  `host:port` format)\n- **Shell command**: Execute arbitrary shell commands and wait for successful\n  completion\n- **Configurable timeouts**: Customizable sleep intervals and timeout periods\n- **User-friendly output**: Clear progress indicators and status messages\n- **Multi-architecture support**: Available for `linux/amd64` and `linux/arm64`\n\n## Example usage:\n\n### TCP Connectivity\n\nWait for services to accept TCP connections on specific ports:\n\n```yaml\nservices:\n  database:\n    image: postgres:15-alpine\n    environment:\n      POSTGRES_PASSWORD: secret\n    ports:\n      - \"5432:5432\"\n\n  cache:\n    image: redis:7-alpine\n    ports:\n      - \"6379:6379\"\n\n  app:\n    image: alpine:3.22\n    depends_on:\n      # Will start only after the wait-for-dependencies finishes waiting\n      # for both database and cache to be reachable.\n      wait-for-dependencies:\n        condition: service_completed_successfully\n    ports:\n      - \"8000:8000\"\n\n  wait-for-dependencies:\n    image: drevops/docker-wait-for-dependencies:25.9.0\n    depends_on:\n      - database\n      - cache\n    command: database:5432 cache:6379\n```\n\n### Combined TCP and Health Check Commands\n\nWait for both TCP connectivity and custom health check endpoints:\n\n```yaml\nservices:\n  api:\n    image: php:8.3-cli-alpine\n    ports:\n      - \"8080:8080\"\n    command: php -S 0.0.0.0:8080 -t /app\n\n  worker:\n    image: alpine:3.18\n    ports:\n      - \"9000:9000\"\n    command: nc -l -p 9000\n\n  app:\n    image: alpine:3.22\n    depends_on:\n      # Will start only after the wait-for-dependencies finishes waiting\n      # for both api and worker to be reachable.\n      wait-for-dependencies:\n        condition: service_completed_successfully\n    ports:\n      - \"8000:8000\"\n\n  wait-for-dependencies:\n    image: drevops/docker-wait-for-dependencies:25.9.0\n    depends_on:\n      - api\n      - worker\n    command:\n      - api:8080\n      - worker:9000\n      - \"curl -f http://api:8080/health\"\n      - \"test -S /var/run/app.sock\"\n```\n\n## Configuration\n\nThe container supports the following environment variables:\n\n| Variable          | Default | Description                                                |\n|-------------------|---------|------------------------------------------------------------|\n| `SLEEP_LENGTH`    | `2`     | Time (in seconds) to wait between each check attempt       |\n| `TIMEOUT_LENGTH`  | `300`   | Maximum time (in seconds) to wait before giving up         |\n| `SUMMARY_ENABLED` | `true`  | Show summary message when all checks complete successfully |\n\n## Development \u0026 Maintenance\n\n```bash\nnpm run lint # Lint shell scripts and Dockerfile\nnpm run lint-fix # Auto-fix formatting issues\nnpm run test-unit # Run unit tests for validation logic\nnpm run test-functional # Run end-to-end tests with Docker\n```\n\n### Versioning\n\nThis project uses [CalVer](https://calver.org/) versioning:\n\n- `YY`: Last two digits of the year, e.g., `25` for 2025.\n- `m`: Numeric month, e.g., April is `4`.\n- `patch`: Patch number for the month, starting at `0`.\n\nExample: `25.4.2` indicates the third patch in April 2025.\n\n### Releasing\n\nReleases are scheduled to occur at a minimum of once per month.\n\nThe cross-platform images are built by GitHub actions and pushed to DockerHub:\n\n- `YY.m.patch` tag - when release tag is published on GitHub.\n- `latest` - when release tag is published on GitHub.\n- `canary` - on every push to `main` branch\n\n### Dependencies update\n\nRenovate bot is used to update dependencies. It creates a PR with the changes\nand automatically merges it if CI passes. These changes are then released as\na `canary` version.\n\n---\n_This repository was created using the [Scaffold](https://getscaffold.dev/)\nproject template_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrevops%2Fdocker-wait-for-dependencies","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrevops%2Fdocker-wait-for-dependencies","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrevops%2Fdocker-wait-for-dependencies/lists"}