Description
The Dockerfile currently does not include a HEALTHCHECK instruction. Docker and orchestrators (Docker Compose, Kubernetes) use this to determine if the container is healthy.
Suggested approach
- Add a
HEALTHCHECK instruction to the Dockerfile
- Use the existing
/api/health endpoint
- Example:
HEALTHCHECK --interval=30s --timeout=5s --retries=3 CMD curl -f http://localhost:3000/api/health || exit 1
Files to look at
Dockerfile
src/app/api/health/ — existing health check endpoint
Quick and straightforward change — great for getting familiar with the Docker setup.
Description
The Dockerfile currently does not include a
HEALTHCHECKinstruction. Docker and orchestrators (Docker Compose, Kubernetes) use this to determine if the container is healthy.Suggested approach
HEALTHCHECKinstruction to the Dockerfile/api/healthendpointHEALTHCHECK --interval=30s --timeout=5s --retries=3 CMD curl -f http://localhost:3000/api/health || exit 1Files to look at
Dockerfilesrc/app/api/health/— existing health check endpointQuick and straightforward change — great for getting familiar with the Docker setup.