Healthcheck
Health check in docker-compose.yml is usually done as:
healthcheck: test: ['CMD', 'curl', '--fail', 'http://localhost:8080/health'] interval: 10s timeout: 5s retries: 5but when curl or wget are not available in minimalistic images the same can
be achieved using following healthcheck.sh script
#!/bin/bash
exec 5<> /dev/tcp/localhost/8080cat <&5 &printf "GET /health HTTP/1.0\r\n\r\n" >&5then in docker compose
volumes: - ./healthcheck.sh:/healthcheck.shhealthcheck: test: ['CMD', '/healthcheck.sh'] interval: 10s timeout: 5s retries: 5