Deploying from Git
Step-by-step guide to deploying applications directly from Git repositories
Deploy directly from your Git repository with automatic builds and deployments on every push. Sproobo supports GitHub.
ℹ️
Git deployments automatically build and deploy your application whenever you push to the configured branch.
Prerequisites
Before deploying from Git, ensure your repository has:
Repository Requirements
- Dockerfile: Required for building the application
- docker-compose.yml: Optional, for multi-container apps
- .dockerignore: Recommended, to exclude unnecessary files
- Application code: Your application source code
Connecting Your Repository
- 1
Navigate to Deployments
In your project dashboard, click on "Deployments" and then "Create Deployment". - 2
Choose Git Deployment
Select "Deploy from Git" as your deployment source.Select Deploy from Git as your deployment method. - 3
Connect Git Provider
If you haven't already, connect your Git provider account:- Click "Connect GitHub" and authorize Sproobo to access your repositories
- Authorize Sproobo to access your repositories
- Grant necessary permissions for repository access and webhooks
Authorize Sproobo to access your Git repositories. - 4
Select Repository
Choose the repository you want to deploy from your connected accounts.Select the repository you want to deploy. - 5
Configure Branch
Select which branch to deploy from (typically "main" or "master").Branch Options
- Main Branch: Production deployments from main/master
- Preview Deployments: Deploy from feature branches for testing
- Tag Deployments: Deploy specific versions using tags
Select the branch you want to deploy from. - 6
Configure Build Settings
Configure how your application will be built:- Dockerfile Path: Location of your Dockerfile (default: "./Dockerfile")
- Build Context: Build context directory
- Build Arguments: Additional build arguments for Docker
- Build Command: Optional custom build command
Configure build settings for your Docker build. - 7
Configure Deployment
Set deployment-specific settings:- Deployment Name: A descriptive name for your deployment
- Server: Select which server to deploy to
- Port: Internal port your app will use
- Environment Variables: Add any required environment variables
- Health Check Path: Path for health check endpoint
Configure deployment settings including server, port, and environment variables. - 8
Review and Deploy
Review your configuration and click "Deploy". Sproobo will:- Clone your repository
- Build your Docker image
- Push the image to the registry
- Deploy to your server
- Set up HTTPS and routing
- Configure automatic deployments
Watch as your application is built and deployed automatically.
Automatic Deployments
Once connected, Sproobo will automatically deploy on every push:
- 1
Webhook Setup
Sproobo automatically sets up webhooks in your repository to listen for pushes.Sproobo automatically configures webhooks in your repository. - 2
Automatic Build
When you push to the configured branch, Sproobo will:- Detect the push event
- Start a new build
- Build your Docker image
- Deploy to your server
Every push to your branch triggers an automatic deployment. - 3
Deployment Status
Track deployment status in the Sproobo dashboard:- Build progress and logs
- Deployment status
- Commit hash and author
- Deployment duration
Monitor deployment progress and status in real-time.
Dockerfile Best Practices
To ensure successful builds, follow these Dockerfile best practices:
Dockerfile Tips
- Multi-stage builds: Use multi-stage builds to reduce image size
- Layer caching: Order instructions from least to most frequently changed
- Security: Don't run as root user, use non-root user
- Health checks: Include HEALTHCHECK instruction
- Minimize layers: Combine RUN commands to reduce layers
Environment Variables
Configure environment variables for your deployment:
- 1
Add Environment Variables
Go to Deployment → Settings → Environment Variables.Add environment variables for your deployment. - 2
Secure Variables
Mark sensitive variables as "Secret" to encrypt them at rest.⚠️Secret variables are encrypted and never shown in logs or UI. Use these for API keys, passwords, and tokens.
Manual Deployments
You can also trigger manual deployments:
- 1
Redeploy
Go to Deployment → Actions → Redeploy to manually trigger a deployment. - 2
Deploy Specific Commit
Choose to deploy a specific commit or tag from the deployment history.Manually trigger deployments from the Sproobo dashboard.
Next Steps
Now that your Git deployment is set up: