waitup 1.0.0

Wait for TCP ports and HTTP endpoints to be available. Essential for Docker, K8s, and CI/CD pipelines to ensure services are ready before proceeding.
Documentation
# Example Docker Compose demonstrating waitup usage
version: "3.8"

services:
  # Database service
  postgres:
    image: postgres:15-alpine
    environment:
      POSTGRES_DB: testdb
      POSTGRES_USER: testuser
      POSTGRES_PASSWORD: testpass
    ports:
      - "5432:5432"
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U testuser -d testdb"]
      interval: 5s
      timeout: 5s
      retries: 5

  # Redis cache
  redis:
    image: redis:7-alpine
    ports:
      - "6379:6379"
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 5s
      timeout: 3s
      retries: 5

  # Example web API that depends on database and cache
  web-api:
    image: nginx:alpine
    ports:
      - "8080:80"
    depends_on:
      postgres:
        condition: service_healthy
      redis:
        condition: service_healthy

  # Example: Using waitup as init container
  app-with-waitup:
    image: alpine:latest
    depends_on:
      - postgres
      - redis
      - web-api
    command: |
      sh -c "
        # Install waitup (in real usage, you'd use the waitup image)
        echo 'Simulating waitup checking dependencies...'
        sleep 2
        echo 'Dependencies ready! Starting application...'
        sleep 10
        echo 'Application running...'
      "

  # Example: Using waitup container directly
  waitup-example:
    build:
      context: .
      dockerfile: Dockerfile
    command: |
      postgres:5432
      redis:6379
      web-api:80
      --timeout 60s
      --interval 2s
      --verbose
      --
      echo "All services are ready! Application can start now."
    depends_on:
      - postgres
      - redis
      - web-api

  # Example: Wait for external HTTP service
  waitup-http:
    build:
      context: .
      dockerfile: Dockerfile
    command: |
      https://httpbin.org/status/200
      --expect-status 200
      --timeout 30s
      --json
    profiles:
      - http-example

  # Example: Wait for any of multiple services (failover scenario)
  waitup-any:
    build:
      context: .
      dockerfile: Dockerfile
    command: |
      postgres:5432
      backup-postgres:5432
      --any
      --timeout 30s
      --verbose
      --
      echo "At least one database is available!"
    depends_on:
      - postgres
    profiles:
      - failover-example

# Example networks
networks:
  default:
    driver: bridge

# Example volumes
volumes:
  postgres_data:
    driver: local
  redis_data:
    driver: local