Open y12studio opened 2 months ago
Thanks a lot for your suggestion @y12studio. I like your idea to make it easier for first-time Restate users to get things up and running. The one thing I would actually exclude from the docker compose script is the actual curl. Do you think that such a compose file would be helpful?
services:
endpoint:
image: node:20.15
working_dir: /endpoint
ports:
- "9080:9080"
command:
- /bin/bash
- -c
- |
if [ ! -d "examples" ]; then
git clone --depth=1 https://github.com/restatedev/examples.git
fi
cd examples/basics/basics-typescript/
npm install
npm run ${EXAMPLE:-example-1}
healthcheck:
test: curl --http2-prior-knowledge http://localhost:9080 || exit 1
interval: 5s
retries: 10
start_period: 5s
timeout: 10s
restate:
image: docker.io/restatedev/restate:latest
pull_policy: always
ports:
- 8080:8080
- 9070:9070
- 9071:9071
register_endpoint:
image: docker.io/curlimages/curl:8.8.0
depends_on:
endpoint:
condition: service_healthy
restate:
condition: service_started
command:
- /bin/sh
- -c
- |
curl --retry 10 http://restate:9070/deployments -H 'content-type: application/json' -d '{"uri": "http://endpoint:9080"}'
echo "Endpoint successfully registered"
Currently, newcomers to Restate example face a challenge when trying to understand the sequence of durable execution events. They need to monitor multiple terminals simultaneously, which can be overwhelming and confusing. To enhance the learning experience and provide clearer guidance, I recommend introducing a new section in the basics-typescript/README.md file, specifically focused on 'Running Examples with Docker Compose'.
Expected benefits:
By implementing this change, we can significantly lower the entry barrier for beginners, helping them grasp the core concepts of durable execution more quickly and effectively.
compose.yaml