{"id":21649503,"url":"https://github.com/ctronp/healthcheck","last_synced_at":"2025-07-19T01:36:41.990Z","repository":{"id":264502079,"uuid":"893547378","full_name":"ctronp/healthcheck","owner":"ctronp","description":"Placeholder for health checks in AWS NLB services. Responds with `HTTP 200 OK` to any request, ideal for testing or initial configurations without additional logic.","archived":false,"fork":false,"pushed_at":"2025-04-23T05:17:42.000Z","size":34,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T20:35:30.982Z","etag":null,"topics":["aws","axum","docker","graceful-shutdown","healthcheck","http","microservices","nlb","rust","server"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/ctronp.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,"zenodo":null}},"created_at":"2024-11-24T18:11:19.000Z","updated_at":"2025-04-23T05:17:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"733d37bb-e162-4650-bc16-161c209bf84f","html_url":"https://github.com/ctronp/healthcheck","commit_stats":null,"previous_names":["ctronp/healthcheck"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ctronp/healthcheck","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctronp%2Fhealthcheck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctronp%2Fhealthcheck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctronp%2Fhealthcheck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctronp%2Fhealthcheck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ctronp","download_url":"https://codeload.github.com/ctronp/healthcheck/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctronp%2Fhealthcheck/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265871377,"owners_count":23842026,"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":["aws","axum","docker","graceful-shutdown","healthcheck","http","microservices","nlb","rust","server"],"created_at":"2024-11-25T07:31:43.245Z","updated_at":"2025-07-19T01:36:41.962Z","avatar_url":"https://github.com/ctronp.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Healthcheck Service\n\nA lightweight and customizable healthcheck service built with Rust and Axum. It supports multiple ports and paths\nconfigured through environment variables, making it ideal for scenarios requiring dynamic health checks, such as AWS\nNetwork Load Balancer (NLB) integrations.\n\n## Features\n\n- Responds with `HTTP 200 OK` to any configured path.\n- Supports multiple ports and paths defined via environment variables.\n- Graceful shutdown on receiving a termination signal (e.g., `Ctrl+C`).\n- Logs incoming requests to the console.\n\n## Configuration\n\nThe service uses environment variables to configure its behavior:\n\n### Environment Variables\n\n- `PORT` or `PORTS`: Comma-separated list of ports to listen on. Example: `PORTS=8080,8081`.\n- `HEALTHCHECK` or `HEALTHCHECK_PATH`: Comma-separated list of healthcheck paths. Example:\n  `HEALTHCHECK_PATH=/health,/status`.\n\n### Example\n\n```dotenv\nPORT=8080,8081\nHEALTHCHECK=/health,/status\n```\n\n## Build and Run\n\n### Prerequisites\n\n- Rust toolchain\n- Docker (optional for containerized deployment)\n\n### Build Locally\n\n1. Clone the repository:\n\n```bash\ngit clone \u003crepository_url\u003e\ncd \u003crepository_name\u003e\n```\n\n2. Build the binary:\n\n```bash\ncargo build --release\n```\n\n3. Run the binary:\n\n```bash\nPORT=8080 HEALTHCHECK=/health ./target/release/healthcheck\n```\n\n### Run with Docker\n\n#### Using Docker Compose (Recommended)\n\nThe quickest way to test the service is using the included `docker-compose.yml` file:\n\n```bash\ndocker-compose up\n```\n\nThis will start the service on ports 8001 and 8002 with paths `/health` and `/check-health`.\n\n#### Pre-built Docker Image\n\nUse the pre-built Docker image available for both amd64 and arm64 architectures:\n\n```bash\ndocker run -e PORT=8080,8081 -e HEALTHCHECK=/health -p 8080:8080 -p 8081:8081 ctr0np/healthcheck:latest\n```\n\n#### Build Your Own Image\n\nIf you prefer to build your own image:\n\n```bash\ndocker build -t healthcheck-service .\ndocker run -e PORT=8080 -e HEALTHCHECK=/health -p 8080:8080 healthcheck-service\n```\n\n## Docker Compose Example\n\nThe project includes a `docker-compose.yml` file for easy testing:\n\n```yaml\nservices:\n  healthcheck:\n    build: .\n    ports:\n      - \"8001:8001\"\n      - \"8002:8002\"\n    environment:\n      - PORT=8001,8002\n      - HEALTHCHECK=/health,/check-health\n    restart: unless-stopped\n```\n\nYou can also use the pre-built image in your own docker-compose file:\n\n```yaml\nservices:\n  healthcheck:\n    image: ctr0np/healthcheck:latest\n    ports:\n      - \"8001:8001\"\n      - \"8002:8002\"\n    environment:\n      - PORT=8001,8002\n      - HEALTHCHECK=/health,/check-health\n    restart: unless-stopped\n```\n\n## Project Structure\n\n- **`src/main.rs`**: Main application logic, including router setup and graceful shutdown.\n- **`Dockerfile`**: Multi-stage build for an optimized container image.\n- **`docker-compose.yml`**: Example configuration for easy deployment using Docker Compose.\n- **`Cargo.toml`**: Dependency and configuration file for Rust.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctronp%2Fhealthcheck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fctronp%2Fhealthcheck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctronp%2Fhealthcheck/lists"}