New to Kestra?
Use blueprints to kickstart your first workflows.
Orchestrate Docker Compose with Kestra to spin up an ephemeral test stack on each pull request, smoke-test it, and always tear it down, even on failure.
Validate that your full application stack actually starts and serves before you merge a pull request. This blueprint orchestrates Docker Compose with Kestra to bring up an ephemeral test environment, run an HTTP smoke test against it, and guarantee teardown afterward, so short-lived CI environments never leak containers or volumes. It solves the classic problem of broken integration environments: instead of trusting that a stack "should" boot, you prove it boots and answers on every PR, with cleanup that runs even when the test fails.
io.kestra.plugin.core.trigger.Webhook trigger named on_pull_request receives CI calls when a pull request opens, guarded by a secret webhook key.compose_up task (io.kestra.plugin.docker.Compose) starts the stack in the background with composeArgs set to up -d --wait, so the run blocks until services report healthy.smoke_test task (io.kestra.plugin.core.http.Request) issues a GET against the smoke_test_url input to confirm the stack serves traffic.compose_down task tears the stack down with down -v on the happy path, removing containers and named volumes.errors handler, teardown_on_failure, runs the same down -v when the smoke test or startup fails, so nothing is left running.Each Compose task uses the io.kestra.plugin.scripts.runner.docker.Docker task runner and mounts /var/run/docker.sock to reach the host engine.
up -d --wait instead of fragile sleeps.down -v) on both success and failure paths.Docker Compose can start and stop a stack, but it cannot react to a pull-request event, retry a flaky probe, enforce cleanup when a step fails, or give you execution history and lineage across runs. Kestra adds the event trigger, the error handler that guarantees teardown, declarative YAML you can version, and full observability of every attempt. The webhook trigger and the errors block fill the exact gap Compose's own CLI leaves open: orchestration around the stack, not just the stack itself.
COMPOSE_TEST_WEBHOOK_KEY: key that guards the on_pull_request webhook trigger.COMPOSE_TEST_WEBHOOK_KEY secret to your Kestra namespace.composeFile with your application's real stack.smoke_test_url input at a health endpoint your stack exposes.io.kestra.plugin.core.http.Request tasks.