- Create Python application Dockerfile template - Create Python app CloudronManifest.json template - Create Python app start.sh template - Include Django and Flask support - PostgreSQL integration with wait logic - Django migrations and collectstatic - Admin user creation support - Environment variable configuration - Health check implementation Template features: - Python 3-slim base image - PostgreSQL addon support - Localstorage addon support - Database wait and connection logic - Django-specific support (migrations, collectstatic, admin creation) - Flask support (simple startup) - Configurable workers (NUM_WORKERS) - Port 5000 (configurable) - Health check endpoint Environment variables: - DJANGO_SETTINGS_MODULE: Django settings module - SECRET_KEY: Django secret key - ALLOWED_HOSTS: Allowed hosts for Django - DATABASE_URL: PostgreSQL connection URL (auto-generated) - ADMIN_USERNAME: Admin username (optional) - ADMIN_EMAIL: Admin email (optional) - ADMIN_PASSWORD: Admin password (optional) - NUM_WORKERS: Gunicorn workers (default: 4) 💘 Generated with Crush Assisted-by: GLM-4.7 via Crush <crush@charm.land>
Cloudron Package Templates
This directory contains Cloudron packaging templates for common application types.
Available Templates
1. Python Application Template
File: python-app/Dockerfile.template
Use Case: Simple Python web applications (Flask, Django, etc.)
Dependencies: System packages, pip requirements
2. Go Application Template
File: go-app/Dockerfile.template
Use Case: Go web applications
Build Pattern: Multi-stage (builder + runtime)
3. Node.js Application Template
File: nodejs-app/Dockerfile.template
Use Case: Node.js web applications
Build Pattern: Multi-stage (builder + runtime)
4. Django Application Template
File: django-app/
Use Case: Django web applications with PostgreSQL
Includes: Dockerfile, start.sh
5. Official Image Wrapper Template
File: official-wrapper/Dockerfile.template
Use Case: Applications with existing Docker images
Build Pattern: Simple wrapper with start script
6. README Template
File: README.template.md
Use Case: All applications
Includes: Standard documentation sections
How to Use Templates
1. Copy Template
# Choose appropriate template
cp -r python-app /path/to/new-package
2. Customize
# Edit Dockerfile.template
# Edit CloudronManifest.json.template
# Customize for your application
3. Build
# Test build locally
docker build -t myapp:test .
Template Structure
Each template includes:
- Dockerfile.template: Docker configuration
- CloudronManifest.json.template: Cloudron manifest
- start.sh.template: Startup script (if needed)
- .env.example: Environment configuration
- README.template.md: Documentation template
- CHANGELOG.template.md: Changelog template
Customization Points
Dockerfile
- Base image selection
- Dependency installation
- Build commands
- Runtime configuration
- Port exposure
- Health checks
CloudronManifest.json
- Application ID (io.cloudron.appname)
- Title and description
- Ports configuration
- Addons selection
- Memory limits
- Health check paths
Start Script
- Database wait logic
- Migration commands
- Configuration generation
- Application startup
Common Patterns
Database Integration
PostgreSQL:
"addons": {
"postgresql": {
"version": "14"
}
}
MySQL:
"addons": {
"mysql": {
"version": "8"
}
}
Storage
Localstorage:
"addons": {
"localstorage": true
}
Memory Limits
- Small apps: 512MB
- Medium apps: 1024MB (1GB)
- Large apps: 2048MB (2GB)
- Very large apps: 4096MB (4GB)
Best Practices
- Use official images when available
- Multi-stage builds for compiled applications
- Wait for dependencies (database, services)
- Health checks on all services
- Environment variable defaults:
${VAR:-default} - Make scripts executable on host, not in Docker RUN
- Use .dockerignore to reduce build context
- Document all settings in .env.example
- Test builds locally before committing
- Follow Cloudron conventions for consistency
Documentation Reference
For more details on Cloudron packaging patterns:
- See
../JOURNAL.mdfor detailed analysis of completed packages - See
../AGENTS.mdfor established patterns and learnings - See Cloudron Documentation
- See Cloudron Repository
Support
For questions about templates:
- Refer to
../JOURNAL.mdfor detailed examples - Use patterns from
../AGENTS.md - Check completed packages for reference
Templates are based on packages created for TSYSDevStack-SupportStack-Cloudron project.