Building your SaaS Product from Source Repository¶
Omnistrate allows you to build your SaaS Product directly from your source code repository. This approach is ideal when you have application source code in Git repositories with a Dockerfile and want Omnistrate to handle the build and deployment process.
Overview¶
When you build from a source repository, Omnistrate:
- Builds Docker containers from your repository using your existing Dockerfile
- Pushes the built image to a container registry
- Creates and deploys your service on the Omnistrate platform
- Integrates with your CI/CD workflows for automated deployments
- Supports any application that can be containerized with Docker
This approach is perfect for:
- Applications with Dockerfiles that are ready to be containerized
- Teams using AI coding assistants like GitHub Copilot or Cursor to generate Dockerfiles
- Existing containerized applications that you want to deploy as SaaS
- CI/CD integration where builds trigger automatically from code changes
Prerequisites¶
Before building from your repository, ensure you have:
- Omnistrate Account: Sign up at omnistrate.cloud
- Omnistrate CLI: Install from ctl.omnistrate.cloud/install
- Source Repository: Your application code in a Git repository (GitHub, GitLab, Bitbucket, etc.)
- Dockerfile: A valid Dockerfile in your repository root (can be generated using AI tools like GitHub Copilot or Cursor)
- Docker Daemon: Docker running on your local machine for building the image
- Repository Access: Ensure you have access to push to container registries
Supported Applications¶
Since the build-from-repo command works with any valid Dockerfile, it supports any application that can be containerized:
Web Applications¶
- Node.js (Express, Next.js, Nuxt.js, etc.)
- Python (Django, Flask, FastAPI, etc.)
- Java (Spring Boot, Maven, Gradle projects)
- Go applications
- PHP (Laravel, Symfony, etc.)
- Ruby (Rails, Sinatra, etc.)
- .NET applications
- Static sites (React, Vue, Angular, etc.)
Databases and Data Services¶
- PostgreSQL with custom extensions
- MySQL with custom configurations
- Redis with custom modules
- MongoDB with custom setups
- ClickHouse, TimescaleDB, and other specialized databases
Microservices and APIs¶
- REST APIs in any supported language
- GraphQL services
- gRPC services
- Message queues and event streaming
- Background workers and batch processing jobs
AI/ML Applications¶
- Python ML models (TensorFlow, PyTorch, scikit-learn)
- Jupyter notebooks as services
- Model inference APIs
- Data processing pipelines
Getting Started¶
Step 1: Prepare Your Repository¶
Ensure your repository contains:
- Application Source Code: Your main application files
- Dockerfile: A valid Dockerfile that can build your application (required)
- Dependency Files: Package files like
package.json
,requirements.txt
,pom.xml
,go.mod
, etc. - Configuration Files: Any necessary config files for your application
Creating a Dockerfile with AI Assistance¶
If you don't have a Dockerfile, you can easily create one using AI coding assistants:
Using GitHub Copilot:
- Create a new file named
Dockerfile
in your repository root - Add a comment describing your application:
# Dockerfile for Node.js Express application
- Let Copilot suggest the Dockerfile content
Using Cursor:
- Open your project in Cursor
- Create a
Dockerfile
and use Cursor's AI to generate the content - Describe your application stack and let the AI create the appropriate Dockerfile
Example AI prompt:
Create a Dockerfile for a Node.js Express application that:
- Uses Node.js 18 Alpine base image
- Installs dependencies from package.json
- Exposes port 3000
- Runs the application with npm start
Step 2: Build Your Service¶
Use the Omnistrate CLI to build your service directly from the repository. Run this command from the root of your repository:
You can also specify additional options:
# Build with environment variables (when no compose spec exists)
omnistrate-ctl build-from-repo --product-name "My App" --env-var POSTGRES_PASSWORD=default\
The CLI will:
- Build the Docker image from your Dockerfile
- Push the image to Github Container registry
- Generate a compose specification (if one doesn't exist)
- Create your service on the Omnistrate platform
- Set up the infrastructure according to your specification
- Initialize the SaaS portal for customer access
Step 4: Monitor the Build Process¶
During the build process, you'll see output similar to:
✓ Docker image built successfully
✓ Container image pushed to registry
✓ Compose specification generated
✓ Service created successfully
✓ Environment promoted to production
✓ SaaS portal initialized
Check your service at: https://omnistrate.cloud/product-tier?serviceId=s-abc123&environmentId=se-def456
Access your Customer Portal at: https://saasportal.instance-xyz.omnistrate.cloud/service-plans?serviceId=s-abc123
You can use command line or the customer portal to create an instance of the service.
Next Steps¶
After successfully building from your repository:
- Test Your Service: Use the provided Customer Portal URL to test deployments
- Configure Environments: Set up development, staging, and production environments
- Set Up Monitoring: Enable logging and metrics
- Implement CI/CD: Automate deployments with your preferred CI/CD platform
- Add Advanced Features: Explore Build Guide and Runtime Guide for advanced features.
If you need help to setup your SaaS Product reach out to us at support@omnistrate.com.
Example Reference¶
For a complete working example, see the Ray cluster repository which demonstrates building a distributed computing platform with multiple services and Private AI Chatbot which demonstrates multi-tenant ChatBot for managing AI-powered chat interactions.