Home/Docs/Examples

Examples

Reference deployment shapes for common TurboCI workloads.

Use these examples as starting points when modeling application services, load balancers, Docker workloads, and multi-cloud fleets.


5 patterns

cover the most common production and staging layouts

YAML first

every example stays close to the operational model TurboCI expects


example-index
yaml
# Patterns covered here - Next.js app with load balancer - Multi-cloud duplication - SSL routing - Docker service - Service duplication

Reference library

Pick the shape closest to the workload you are deploying


Next.js + balancer

Production web app with clustered instances

A multi-instance Next.js application fronted by a load balancer and guarded with health checks.

example
yaml
- deployment_name: nextjs_prod provider: hetzner location: ash description: Production Next.js deployment services: web: instances: 2 clusters: 2 server_type: cpx21 dir_mappings: - src: . dst: /app - src: ./secrets/prod.env dst: /app/.env dependencies: apt: - rsync turboci: - bun - node run: preflight: work_dir: /app cmds: - bun add -g pm2 - pm2 kill - bun install - bunx next build start: work_dir: /app cmds: - pm2 start "bunx next start" postflight: cmds: - pm2 list healthcheck: cmd: curl http://localhost:3000/api/healthcheck test: Server Running logs: - pm2 logs web - cmd: tail -f /var/log/nginx/error.log load_balancer: type: load_balancer target_services: - service_name: web port: 3000

Multi-cloud

Duplicate one deployment shape into another provider

The same service graph can be mirrored into AWS, GCP, or Azure using deployment duplication.

example
yaml
- deployment_name: web_hetzner provider: hetzner location: ash services: web: instances: 2 clusters: 2 server_type: cpx21 dir_mappings: - src: . dst: /app run: start: work_dir: /app cmds: - npm start - deployment_name: web_aws provider: aws location: us-east-1 duplicate_deployment_name: web_hetzner

SSL routing

One load balancer serving multiple domains

Target multiple services behind the same balancer and provision certificates with Let's Encrypt.

example
yaml
services: web_prod: instances: 5 clusters: 2 server_type: cpx21 web_dev: instances: 2 clusters: 1 server_type: cpx11 load_balancer: type: load_balancer target_services: - service_name: web_prod port: 3000 domains: - example.com - www.example.com - service_name: web_dev port: 3000 domains: - dev.example.com ssl: email: admin@example.com

Docker service

Containerized workloads on VPS infrastructure

TurboCI can install Docker automatically and start a Compose-based workload from the configured working directory.

example
yaml
services: app: type: docker instances: 3 clusters: 2 server_type: cpx21 dir_mappings: - src: . dst: /app run: start: work_dir: /app cmds: - docker-compose up -d

Service duplication

Clone one service definition into another environment

Use `duplicate_service_name` when production and staging share the same process model but differ in scale or instance size.

example
yaml
services: web_prod: instances: 10 clusters: 3 server_type: cpx31 dir_mappings: - src: . dst: /app dependencies: turboci: - node run: start: work_dir: /app cmds: - npm start logs: - pm2 logs web_prod env: NODE_ENV: production web_staging: duplicate_service_name: web_prod instances: 2 clusters: 1 server_type: cpx11 env: NODE_ENV: staging

Next step

Return to the landing page

Once the examples are familiar, go back to the main site to download TurboCI or revisit the product overview.

Back to home