Open jalbiero opened 1 month ago
curl could help us to add custom health checks like Jalbiero or :
healthcheck:
test: curl --insecure --fail https://localhost:8081/_explorer/index.html
I am using the following workaround, a "wrapper" image (cosmos-emulator-wrapper) that contains the curl
utility:
services:
CosmosDb:
image: cosmos-emulator-wrapper
build:
dockerfile_inline: |
FROM mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latest
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
curl
ports:
- 443:443
- 8081:8081
- 10250-10255:10250-10255
healthcheck:
test: ["CMD", "curl", "-f", "-k", "https://localhost:8081/_explorer/emulator.pem"]
interval: 10s
retries: 12
timeout: 3s
Describe the bug The linux emulator doesn't provide the
curl
command (or similar likewget
), so it is not possible to perform a basichealtcheck
(as is usual withdocker compose
)Disclaimer: IMHO this is a bug, not a feature request, because a common operation with
docker compose
cannot be performed (unless there is an alternative way to check when CosmosDB service is ready)To Reproduce
curl
is missing:Expected behavior If
curl
is provided the following is expected:Desktop
Docker Images Used
Docker Environment