Repository navigation
Custom Services Migration
Moving a hand-written compose fragment (docker-compose.<name>.yml, docker-compose.override.yml) to CS_N keys, so that nself build owns the only compose file. Each pattern below names the keys that replace it. Patterns that CS_N cannot express yet are listed as gaps with a debt id.
The key reference is in Config-Custom-Services. This page is the map from compose to keys.
| Compose pattern |
CS_N keys |
|---|---|
build.context at the monorepo root, dockerfile deep inside |
CS_N_PATH=../.. and CS_N_DOCKERFILE=<path from the root>. The root needs a .dockerignore with **/.env* and **/.secrets. |
Multi-stage build.target
|
CS_N_BUILD_TARGET=<stage> |
env_file with two or more files |
CS_N_ENV_FILE=.env.dev,.env.secrets (later wins) |
depends_on a core service with a health condition |
CS_N_DEPENDS_ON=hasura:healthy (started, healthy, completed) |
depends_on a service from a plugin |
CS_N_DEPENDS_ON=<plugin service name>, resolved after the plugin step |
command as a list |
CS_N_COMMAND=node dist/server.js (whitespace split, no shell) |
networks with an existing project network |
CS_N_NETWORKS=<PROJECT_NAME>_<name> (external, must exist) |
image pinned by tag or digest |
CS_N_IMAGE=... |
| Read-only config mounted from the project | CS_N_VOLUMES=./conf/app.conf:/etc/app.conf:ro |
| Healthcheck on another path or with a command |
CS_N_HEALTHCHECK=/path or CMD ...
|
| Memory and CPU limits |
CS_N_MEMORY, CS_N_CPU
|
Variables from the project .env
|
CS_N_ENV_PASSTHROUGH=A,B |
| Several containers of one third-party stack | One CS_N_IMAGE service per container, or a plugin |
| A one-shot init job that must finish first | A CS_N_IMAGE service with CS_N_COMMAND; the other service uses CS_N_DEPENDS_ON=<job>:completed. The restart policy gap below applies. |
- A custom service never joins a network that does not start with
<PROJECT_NAME>_(E501). A fragment that creates its own isolated networks does not map; see gap 6. - An unknown dependency name fails the build (E500), naming the key and the name.
- An ancestor build context above the repository root, or without an ignore file that excludes
**/.env*and**/.secrets, fails (E528). A dependency cycle between services fails (E500). - v1.5 mode (
NSELF_V15=1): a writable absolute host bind outside the project, and any bind of/var/run/docker.sockor/, fail with E502. v1.4 mode warns once for the socket and host root. See Compat-V15.
These compose features have no CS_N key. Keep them out of fragments: move the service to the closest pattern above and accept the default, or wait for the debt item.
| Gap | Where it shows up | Debt id |
|---|---|---|
Per-service logging options, restart policy (restart: "no" for one-shot jobs), container_name and image: tag for a built service |
Every fragment repeats the same json-file rotation; init jobs need restart: "no"
|
D-A01-1 |
extra_hosts, tmpfs, entrypoint, working_dir, user
|
Proxy and tool containers | D-A01-2 |
Declaring a named volume used by CS_N_VOLUMES (data:/var/lib/x) at the top level of the generated compose |
Databases, brokers and replicas that keep state | D-A01-3 |
| Overriding a core service (nginx, hasura) from outside its own config keys | Host-gateway entries, entrypoint delays, per-service memory reservations | D-A01-4 |
Variable expansion inside CS_N_COMMAND (it has no shell) |
A command that carries a password | D-A01-5 |
| Stacks with their own isolated networks and many containers (an observability suite) | Ten or more services, two private networks | D-A01-6 (plugin) |
Until the debt items land, a service that needs one of these stays a CS_N_IMAGE or build service without that feature, or becomes a plugin.
- Set the keys, then run
nself build. It fails with E500, E501, E502 or E528 and a message that names the key. - Compare the generated service with the fragment you are replacing. The generated container name is
<PROJECT_NAME>_<service>, with the service name hyphenated, so update anything that referenced the old container name (nginx upstreams, monitoring). - Remove the fragment and run
nself start.
nself build
nself startGetting Started
Commands
- Commands, Overview
- Lifecycle: cmd-init · cmd-build · cmd-start · cmd-stop · cmd-restart · cmd-dev
- Monitoring: cmd-status · cmd-logs · cmd-health · cmd-urls · cmd-doctor · cmd-monitor · cmd-alerts · cmd-sentry · cmd-watchdog
- Data: cmd-db · cmd-backup · cmd-dr · cmd-queue · cmd-webhooks
- Config: cmd-config · cmd-service · cmd-env · cmd-promote
- Networking: cmd-ssl · cmd-trust · cmd-dns-setup
- Security: cmd-access · cmd-security · cmd-secrets
- Tenancy: cmd-tenant · cmd-billing
- Plugins: cmd-plugin · cmd-license · cmd-dogfood (extracted, CLI-R11) · cmd-k8s (extracted, CLI-R11) · cmd-encryption (extracted, CLI-R11) · cmd-waf (extracted, CLI-R11) · cmd-federation (extracted, CLI-R11) · cmd-mail (extracted, CLI-R11) · cmd-dlq (extracted, CLI-R11)
- AI: cmd-ai · cmd-claw · cmd-model
- Templates: cmd-template
- Utilities: cmd-exec · cmd-clean · cmd-reset · cmd-update · cmd-upgrade · cmd-version · cmd-admin · cmd-migrate · cmd-migrate-firebase · cmd-migrate-supabase · cmd-completion
Features
- Features, Overview
- Feature-Auth
- Feature-Storage
- Feature-Search
- Feature-Functions
- Feature-Email
- Feature-Monitoring
- Feature-Plugins
- Feature-nClaw, AI Assistant
- Feature-nChat, Messaging
- Feature-nFamily, Family Social
- Feature-nCloud, Managed Hosting
- Feature-Memory-Rooms, Knowledge Organization
- Feature-Agent-Dashboard, Agent Metrics
- Feature-Image-Generation, AI Image Generation
Configuration
- Configuration, Overview
- Config-Env-Vars
- Config-Postgres
- Config-Hasura
- Config-Auth
- Config-Nginx
- Shared-Proxy
- Config-Optional-Services
- Config-Custom-Services
- Config-System
Plugins (87 + 10 monitoring)
- Plugin-Overview
- Plugin-Catalog
- Plugin-Install
- Plugin-Licensing
- Plugin-Architecture
- Plugin-Dev-Guide
- Plugin-Migrations-Contract
Free (25)
- plugin-backup
- plugin-content-acquisition
- plugin-content-progress
- plugin-cron
- plugin-donorbox
- plugin-feature-flags
- plugin-github
- plugin-github-runner
- plugin-invitations
- plugin-jobs
- plugin-link-preview
- plugin-mdns
- plugin-mlflow
- plugin-monitoring
- plugin-notifications
- plugin-notify
- plugin-paypal
- plugin-search
- plugin-shopify
- plugin-stripe
- plugin-subtitle-manager
- plugin-tokens
- plugin-torrent-manager
- plugin-vpn
- plugin-webhooks
Pro (62)
- plugin-access-controls
- plugin-activity-feed
- plugin-admin-api
- plugin-analytics
- plugin-auth
- plugin-bots
- plugin-browser
- plugin-calendar
- plugin-cdn
- plugin-chat
- plugin-claw
- plugin-claw-budget
- plugin-claw-news
- plugin-claw-web
- plugin-cloudflare
- plugin-cms
- plugin-compliance
- plugin-ddns
- plugin-devices
- plugin-documents
- plugin-entitlements
- plugin-file-processing
- plugin-game-metadata
- plugin-geocoding
- plugin-geolocation
- plugin-google
- plugin-home
- plugin-idme
- plugin-knowledge-base
- plugin-linkedin
- plugin-livekit
- plugin-media-processing
- plugin-meetings
- plugin-moderation
- plugin-mux
- plugin-object-storage
- plugin-observability
- plugin-photos
- plugin-podcast
- plugin-post
- plugin-realtime
- plugin-retro-gaming
- plugin-rom-discovery
- plugin-social
- plugin-sports
- plugin-support
- plugin-tmdb
- plugin-voice
- plugin-web3
- plugin-workflows
Planned (26)
plugin-auditplugin-blogplugin-checkoutplugin-commerceplugin-drmplugin-exportplugin-flowplugin-importplugin-ldapplugin-mailgunplugin-mediaplugin-oauth-providersplugin-pagesplugin-postmarkplugin-rate-limitplugin-reportsplugin-samlplugin-schedulerplugin-sendgridplugin-ssoplugin-subscriptionplugin-thumbplugin-transcoderplugin-twilioplugin-wafplugin-watermark
Guides
- Guide-Production-Deployment
- Guide-SSL-Setup
- Guide-Multi-Tenancy
- Guide-Security-Hardening
- Guide-Monitoring-Setup
- Guide-Backup-Restore
- Guide-Custom-Services
- Guide-Migration-from-v1
Architecture
- Architecture
- Architecture-Guardrails
- Service-Graph
- Compose-Generation
- Nginx-Generation
- Plugin-Architecture
Reference
Machine interface
-
JSON-Output,
--jsonenvelope -
Command-Registry,
nself help --json - Exit-Codes
- error-codes, Error Codes
-
Compat-V15,
NSELF_V15gate
Licensing
Security
Brand
Operations
- operations/release-cascade, Release Cascade
- operations/self-healing, Self-Healing Schema
- operations/redis-tuning, Redis Pool Tuning
- operations/meilisearch-warmup, MeiliSearch Warm-Up
- operations/jwt-rotation, JWT Key Rotation
- operations/windows-wsl2-setup, Windows / WSL2 Setup
- operations/gemini-oauth-reauth, Gemini OAuth Reauth
Contributing
Admin
- USER-ACTION-QUEUE, Pending Admin Actions
All commands (21)
- A: cmd-add · cmd-admin
- B: cmd-backup · cmd-build
- C: cmd-clean · cmd-config
- D: cmd-db · cmd-deploy · cmd-doctor
- E: cmd-exec
- I: cmd-init
- L: cmd-license · cmd-logs
- M: cmd-mcp
- R: cmd-remove · cmd-reset · cmd-restart
- S: cmd-start · cmd-status · cmd-stop
- U: cmd-update