next.js
next.js copied to clipboard
feat(examples): add Docker health check to all Docker examples
Summary
Add health check functionality to all Docker examples for better container orchestration support (Docker, Kubernetes, ECS, etc.):
- Add
/api/healthendpoint returning{ status: "ok" } - Add
curlpackage to Alpine images for health check command - Add
HEALTHCHECKinstruction to all production Dockerfiles
Affected examples
with-dockerwith-docker-composewith-docker-multi-env
Test plan
- [ ] Build Docker image for each example
- [ ] Verify
/api/healthendpoint returns{ status: "ok" } - [ ] Verify
docker inspect --format='{{.State.Health.Status}}'returnshealthy
Allow CI Workflow Run
- [ ] approve CI run for commit: 34793b5fe2fe621eec40f2b685db3990f2705c92
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer