{"id":19391174,"url":"https://github.com/amulyakashyap09/wait_for_service_not_container","last_synced_at":"2026-04-10T02:50:26.839Z","repository":{"id":143962689,"uuid":"140704313","full_name":"amulyakashyap09/wait_for_service_not_container","owner":"amulyakashyap09","description":"A tutorial on how to wait for services within docker containers.","archived":false,"fork":false,"pushed_at":"2018-07-14T07:49:35.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-07T09:47:08.114Z","etag":null,"topics":["bash-script","bash-scripting","docker","docker-compose","docker-compose-files","docker-compose-wait","dockerfiles","elasticsearch","kafka","kibana","mongodb","rabbitmq","shell","shell-scripting","shell-scripts","shellscript","wait-for-it"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amulyakashyap09.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2018-07-12T11:29:56.000Z","updated_at":"2018-07-14T07:49:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"24b95a1c-5d46-4ba6-a8d4-fb26088663be","html_url":"https://github.com/amulyakashyap09/wait_for_service_not_container","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amulyakashyap09%2Fwait_for_service_not_container","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amulyakashyap09%2Fwait_for_service_not_container/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amulyakashyap09%2Fwait_for_service_not_container/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amulyakashyap09%2Fwait_for_service_not_container/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amulyakashyap09","download_url":"https://codeload.github.com/amulyakashyap09/wait_for_service_not_container/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240557489,"owners_count":19820359,"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","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":["bash-script","bash-scripting","docker","docker-compose","docker-compose-files","docker-compose-wait","dockerfiles","elasticsearch","kafka","kibana","mongodb","rabbitmq","shell","shell-scripting","shell-scripts","shellscript","wait-for-it"],"created_at":"2024-11-10T10:25:17.299Z","updated_at":"2026-04-10T02:50:21.804Z","avatar_url":"https://github.com/amulyakashyap09.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker Compose Wait For Services Script\n\u003e A tutorial on how to wait for services within docker containers.\n\n## Explanation\n\u003e Instead of putting your `wait-script` in `docker-compose.yaml` (as shown in docker-compose docs).\n\u003e You should put your `wait-script` within your source(src) folder\n\u003e And execute `wait.sh` from Dockerfile. \n\n\u003e Whenever your `docker-compose.yaml` file executes it builds from `Dockerfile` and your script executes.\n\u003e Now, execute your binary (`golang binary`) / main file `(main.js)` from `wait.sh`\n\n## Contributing [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/dwyl/esta/issues) ![Chrome Web Store](https://img.shields.io/chrome-web-store/price/nimelepbpejjlbmoobocpfnjhihnpked.svg) ![license](https://img.shields.io/github/license/mashape/apistatus.svg)\n\n* All pull requests are **welcomed**\n* Mail me at `amulyakashyap09@gmail.com`\n\n## Usage\n1. Add your services in your **docker-compose.yaml** file (`vi docker-compose.yaml`)\n```\nzookeeper:\n    image: wurstmeister/zookeeper\n    ports:\n      - \"2181:2181\"\n  kafka:\n    build: .\n    ports:\n      - \"9092\"\n    environment:\n      KAFKA_ADVERTISED_HOST_NAME: 192.168.99.100\n      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181\n    volumes:\n      - /var/run/docker.sock:/var/run/docker.sock\n```\n\n2. Now, Kafka will be accessible via [http://localhost:9092](http://localhost:9092)\n3. Add this command `localhost:9200` to **wait.sh** file (`vi wait.sh`)\n\n```\ndeclare -a HOSTS=(\"localhost:27017\" \"localhost:9200\" \"localhost:5601\" \"localhost:15672\", \"localhost:9092\")\n```\n4. Run Command `docker-compose up`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famulyakashyap09%2Fwait_for_service_not_container","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famulyakashyap09%2Fwait_for_service_not_container","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famulyakashyap09%2Fwait_for_service_not_container/lists"}