Deploy from Git
Deploy directly from any Git repository with automatic builds on push.
Creating a Git Deployment
- Go to Deployments tab
- Click New Deployment
- Select From Git Repository
- Fill in the configuration
Configuration
| Field | Description | Example |
|---|---|---|
| Name | Display name | My API |
| Subdomain | Public URL prefix | api |
| Repository URL | Git clone URL | https://github.com/user/repo.git |
| Branch | Branch to deploy | main |
| Dockerfile Path | Path to Dockerfile | Dockerfile |
Private Repositories
For private repos, include credentials in the URL:
https://username:token@github.com/user/private-repo.gitOr use SSH (requires SSH key on server):
git@github.com:user/private-repo.gitDockerfile Requirements
Your repository must contain a Dockerfile. If it doesn’t:
- Add a Dockerfile to your repo
- Or use Local Project deployment (auto-generates Dockerfile)
Example Dockerfiles
Node.js (Express)
FROM node:20-alpineWORKDIR /appCOPY package*.json ./RUN npm ci --only=productionCOPY . .EXPOSE 3000CMD ["node", "index.js"]Python (FastAPI)
FROM python:3.12-slimWORKDIR /appCOPY requirements.txt .RUN pip install --no-cache-dir -r requirements.txtCOPY . .EXPOSE 8000CMD ["uvicorn", "main:app", "--host", "0.0.0.0"]Go
FROM golang:1.22 AS builderWORKDIR /appCOPY go.* ./RUN go mod downloadCOPY . .RUN CGO_ENABLED=0 go build -o server .
FROM alpine:3.19COPY --from=builder /app/server /serverEXPOSE 8080CMD ["/server"]Triggering Deploys
Manual Deploy
- Go to the deployment
- Click Deploy Now
- Watch the build logs
Automatic via Webhook
Set up GitHub webhooks for automatic deploys on push.
See GitHub Webhooks for setup instructions.
Build Process
When you trigger a deploy:
- Clone — Git clone the repository
- Checkout — Switch to configured branch
- Build — Run
docker build - Push — Push image to internal registry
- Stop — Stop existing container (if any)
- Run — Start new container
- Health Check — Verify container is healthy
Branch Strategies
Single Branch (Recommended for Production)
Deploy main to production:
main branch → api.hosted.yourdomain.comMultiple Deployments
Create separate deployments for different branches:
main branch → api.hosted.yourdomain.comstaging branch → api-staging.hosted.yourdomain.comMonorepo Support
For monorepos, specify the Dockerfile path:
my-monorepo/├── apps/│ ├── api/│ │ └── Dockerfile # Path: apps/api/Dockerfile│ └── web/│ └── Dockerfile # Path: apps/web/Dockerfile└── packages/Build context is the repository root, so your Dockerfile can access all files.
Updating Configuration
To change deployment settings:
- Go to the deployment detail
- Click Settings
- Update fields
- Save changes
Changes take effect on the next deploy.
Deleting Deployments
- Go to the deployment
- Click Delete
- Confirm deletion
This:
- Stops the running container
- Removes the deployment record
- Does NOT delete Git repository