Skip to content

Instantly share code, notes, and snippets.

@mrsimonemms
Last active September 29, 2025 07:56
Show Gist options
  • Save mrsimonemms/9f580e3ceff9cb366aa1468417e3d748 to your computer and use it in GitHub Desktop.
Save mrsimonemms/9f580e3ceff9cb366aa1468417e3d748 to your computer and use it in GitHub Desktop.
Auto-create Temporal search attributes in Docker Compose
services:
# This is your Temporal workflow app - just an example service for demo
workflow:
image: alpine
command: sleep 3600
depends_on:
temporal:
condition: service_healthy
temporal:
image: temporalio/temporal
ports:
- 8080:8233
command: server start-dev --ip 0.0.0.0 --search-attribute YourAttributeName=Keyword --search-attribute Step=Int
healthcheck:
test: ["CMD-SHELL", "temporal operator cluster health"]
interval: 10s
timeout: 10s
retries: 3
# Display the search-attributes - not necessary in reality
temporal-validate:
image: temporalio/temporal
command: |
operator search-attribute list
restart: on-failure
environment:
TEMPORAL_ADDRESS: temporal:7233
depends_on:
temporal:
condition: service_healthy
@mrsimonemms
Copy link
Author

mrsimonemms commented Sep 23, 2025

This is a Docker Compose file which auto-creates the search attributes when you run docker compose up. In this example, the temporal server creates the search attributes at runtime and temporal-validate prints a list of the search attributes created (you should see YourAttributeName and Step added in there).

The workflow isn't really relevant as that's just a long-running container that represents your actual workflow app (it's just an alpine container with a sleep 3600 for this example - you'll need to replace that)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment