Skip to content

Healthcheck / Readiness probe #460

@LukasKnuth

Description

@LukasKnuth

I'm using imposter in my end to end test setup via Docker Compose. Since the application to test depends on making requests to the mocked service quite early, I'd like to start it only when the mock server is up and ready.

In Docker Compose files, you can do this by adding a healthcheck condition to the service and then depend on the service_healthy status in the depends_on declaration:

healthcheck:
  test: ["CMD-SHELL", "curl -f http://imposter:8080 || exit 1"]
  interval: 5s
  timeout: 5s
  retries: 10

I have two questions:

  1. The command given in test is executed inside the container, so any tool to do the actual health check must be in the container. Since the container is quite locked down, I haven't found anything I could use for this purpose. Would you be open to adding a CLI option to the server to check if its up and ready?
  2. If not, is there a good route to query for readiness? I haven't seen the classic /health endpoint.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions