Thank you for your interest in contributing to dstack Examples! This guide will help you contribute new examples or improve existing ones.
We welcome:
- New Examples - Demonstrate new dstack features or use cases
- Example Improvements - Enhance existing examples with better practices
- Documentation - Improve READMEs and inline documentation
- Bug Fixes - Fix issues in existing examples
Consider what your example will demonstrate:
- Security & Attestation - TEE verification, remote attestation patterns
- Networking & Domains - Custom domains, port forwarding, gateway patterns
- Development Tools - Debugging, deployment utilities
- Advanced Use Cases - Complex integrations, blockchain, cryptography
# Create your example directory
mkdir my-example-name
cd my-example-name
# Create required files
touch README.md
touch docker-compose.yaml
touch .env.example # If environment variables are neededYour docker-compose.yaml should follow these patterns:
services:
your-service:
image: your-image@sha256:1234abcd # Use specific image digest to pin the image (not tags)
restart: unless-stopped
environment:
- SOME_API_KEY=${SOME_API_KEY} # Use encrypted secrets when passing sensitive info
ports:
- "8080:80" # Only expose necessary ports
volumes:
- data:/app/data: # Use persistent storage
# Add health checks for production readiness
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/health"]
interval: 30s
timeout: 10s
retries: 3
volumes:
data:Every example MUST include a README.md. Suggested format:
# Example Name
## Description
Brief description of what this example demonstrates and why it's useful.
## Prerequisites
- List any required knowledge
- Required dstack features
- External services needed
## Quick Start
Step-by-step deployment instructions:
1. Copy docker-compose.yaml to your dstack deployment
2. Configure environment variables
3. Deploy through dstack interface
## Configuration
### Environment Variables
| Variable | Description | Required | Default |
|----------|-------------|----------|---------|
| API_KEY | Your api key | Yes | - |
## How It Works
Explain the technical implementation and what makes this example special.
## Security Considerations
- TEE-specific security features used
- Any security best practices demonstrated
- Important security notes
## Troubleshooting
Common issues and solutions.When improving existing examples:
- Maintain Compatibility - Don't break existing deployments
- Update Documentation - Reflect all changes in README
- Test Thoroughly - Ensure improvements work correctly
git clone https://github.com/YOUR-USERNAME/dstack-examples.git
cd dstack-examplesgit checkout -b feat/add-awesome-exampleFollow the patterns above and use an existing example as a reference.
Use conventional commits:
# For new examples
git commit -m "feat: add blockchain verification example"
# For improvements
git commit -m "fix: resolve port conflict in webshell example"
git commit -m "docs: improve attestation example README"
git commit -m "refactor: simplify launcher deployment"git push origin feat/add-awesome-exampleThen create a Pull Request with:
- Clear description of what the example demonstrates
- Any special considerations for reviewers
- Testing steps followed
feat: New example or major feature addition to existing examplefix: Bug fixes in examplesdocs: Documentation improvementsrefactor: Code improvements without changing functionalitytest: Adding tests or test scriptsci: CI/CD related changeschore: Maintenance tasks
## Getting Help
- **Technical Questions**: [GitHub Discussions](https://github.com/Dstack-TEE/dstack-examples/discussions)
- **Bug Reports**: [GitHub Issues](https://github.com/Dstack-TEE/dstack-examples/issues)
- **Real-time Chat**: [Telegram Community](https://t.me/+UO4bS4jflr45YmUx)
## Recognition
Contributors are recognized in:
- Repository contributors list
- Release notes
- Special mentions for significant contributions
Thank you for contributing to dstack Examples! 🎉