Prerequisites
Before you begin, make sure you have:- Understanding of template building - Familiarity with Building Templates is required
- Template builder SDK - Python SDK with template builder (
from hopx_ai.template import Template) - Resource requirements - Know your CPU, memory, and disk requirements
- Build steps - Plan your installation commands and file operations
Overview
Template configuration includes:- Resource specifications (CPU, memory, disk)
- Build steps (commands, file operations)
- Environment variables
- Working directories and users
- Start commands and ready checks
- Port exposure and health checks
Template configuration is set during template building. Once built, templates are immutable - create a new template to change configuration.
Resource Configuration
Configure template resources:- Python
- JavaScript
Build Steps
Configure build steps for template:- Python
- JavaScript
Start Command and Ready Checks
Configure start command and ready checks:- Python
- JavaScript
Port Exposure
Expose ports for services:- Python
- JavaScript
Complete Configuration Example
Here’s a complete template configuration:- Python
- JavaScript
Best Practices
1
1. Configure Resources First
Set appropriate CPU, memory, and disk based on your application requirements.
2
2. Order Build Steps
Order build steps logically: system packages → language packages → application setup.
3
3. Use Ready Checks
Always set ready checks for services that need to be ready before use.
4
4. Set Environment Variables
Configure environment variables during template build for consistency.
5
5. Expose Required Ports
Expose all ports your application needs to be accessible.
Related
- Building Templates - Build custom templates
- Listing Templates - List available templates
- Getting Template Details - View template information
- Creating Sandboxes - Create sandboxes from templates
- CLI Template Commands - Template management from CLI
Next Steps
- Learn about Building Templates to create templates
- Explore Template Caching for build optimization
- Review Getting Template Details to verify configuration

