Monorepos and Multi-Service
Smart Deploy detects multiple deployable units in one repository and lets you deploy each as a separate service with its own scan, config, and URL.
How services are discovered
The service catalog merges several sources (in order):
- Docker Compose directories — one catalog row per compose folder (collapsed for UI)
- Monorepo packages —
apps/*,services/*,packages/*,modules/*,projects/*when workspace tooling exists - Dockerfile directories — any folder with a
Dockerfile - Root siblings — immediate subdirs like
api/+web/without a root workspace - Root app — optional extra row when the repo root is also an app
Libraries under packages/* without start, serve, or dev scripts are skipped.
Monorepo indicators
Detection runs when the repo root has:
pnpm-workspace.yaml, orpackage.jsonwithworkspaces, orturbo.json,nx.json, orlerna.json
Deploying a specific package
Each service row has a package path (for example apps/web). Smart Analysis scopes the scan to that path:
- Classifier and Railpack prepare target the package directory
- Deploy units filter to services under that path
- You get a separate deployment, subdomain, and history per service
Multi-service compose repos
| UI catalog | Deploy-time behavior |
|---|---|
| One row per compose directory | May expand to one deploy unit per compose service |
| Collapsed summary in repo cards | Full unit list in scan deploy_units |
Root compose with app + database services: database-only compose services are filtered out.
Multiple services, multiple URLs
Each service gets:
- Its own
serviceName(for exampleweb,api) - Its own hosted subdomain (must be unique on the platform)
- Its own ALB host rule:
https://{subdomain}.{domain}
Plan subdomains before deploying several services from one monorepo.
Choosing ECS vs S3 per service
Routing is per service based on that service's scan:
- Frontend
static_buildwithout start command → S3 - API
servershape → ECS - Mixed monorepos commonly have both targets in one repo
Adding a service manually
You can add a repo-relative directory as a new service root. Smart Deploy validates the path and infers language/framework for that folder.
Tips
| Scenario | Recommendation |
|---|---|
Turborepo apps/web + apps/api | Deploy each app as its own service |
| Compose at repo root | One catalog entry; review expanded units in scan |
| Only want one service from a big repo | Select the right package path before scanning |
| Shared env vars | Set per deployment; no automatic sharing across services |
Related
- Smart Analysis
- Railpack —
RAILPACK_SPA_OUTPUT_DIRfor monorepo SPAs - Environment Variables