Knowledge
Search knowledge... ⌘K
Knowledge · Guidelines · architecture
Infra Service Deployment
Deploy shared infrastructure services (postgres, redis) to a server as independent Dokploy apps
Metadata
architecture
Procedures
Showing 3 of 4
- 1 Generate per-service compose artifacts from YAML
sbx infra generate reads server YAML and emits: infrastructure/docker/{server}/{env}/{service}/docker-compose.yml infrastructure/docker/{server}/{env}/{service}/.env.example One file per service. .env.example contains op:// refs only (safe to commit).sbx infra generate --server contabo-singapore --env staging # Output: # infrastructure/docker/contabo-singapore/staging/postgres/docker-compose.yml # infrastructure/docker/contabo-singapore/staging/postgres/.env.example # infrastructure/docker/contabo-singapore/staging/redis/docker-compose.yml # infrastructure/docker/contabo-singapore/staging/redis/.env.example git add infrastructure/docker/contabo-singapore/staging/ git commit -m "chore(infra): regenerate staging compose artifacts" git push
- 2 Register services as Dokploy apps (idempotent)
sbx server bootstrap --step applications creates Dokploy compose services from server.yml applications[]. Safe to re-run — existing apps return "exists". Uses sbx.contabo-infra SA token to resolve the Dokploy API key.
sbx server bootstrap contabo-singapore \ --project infrastructure \ --env staging \ --step applications # Creates in Dokploy: # project: infrastructure # app: postgres-staging (compose-from-git) # app: redis-staging (compose-from-git)
- 3 Deploy each service independently
sbx deploy resolves op:// refs locally, pushes plain env to Dokploy, triggers compose rebuild. Each service deploys independently. Use --skip-bump for infrastructure services (no version bump needed).
sbx deploy postgres-staging --env staging --skip-bump sbx deploy redis-staging --env staging --skip-bump # Each triggers independently — redeploying postgres does not restart redis