nself build
nself build
Section titled “nself build”Generate
docker-compose.yml, nginx configs, and SSL certificates from.env.
Synopsis
Section titled “Synopsis”nself build [flags]Description
Section titled “Description”nself build reads your .env cascade and generates all infrastructure configuration files: a docker-compose.yml with every enabled service, nginx reverse-proxy configs, and SSL certificates. It must be run after nself init and after any configuration change before restarting services.
The build pipeline loads configuration from .env.dev → .env.{ENV} → .env.secrets → .env.local → .env, merges plugin configurations from ~/.nself/plugins/, and applies security validation (password strength, no wildcard CORS in production, port binding checks). The result is a single docker-compose.yml that includes core services, optional services, monitoring, custom services (CS_1–CS_10), and any installed plugins.
By default, nself build is smart-cached: it compares .env modification time against docker-compose.yml and skips regeneration when nothing has changed. Use --force to override the cache.
| Flag | Default | Description |
|---|---|---|
--force, -f | false | Force rebuild all components, ignore cache |
--check | false | Validate configuration only, do not write any files |
--verbose, -v | false | Show environment cascade during build |
--quiet, -q | false | Suppress non-error output (CI use) |
--no-cache | false | Disable build cache |
--debug | false | Enable debug mode |
--allow-insecure | false | Allow insecure configuration (dev only) |
--security-report | false | Generate a security analysis after build |
--no-migration-check | false | Skip v1 artifact detection (automation/CI) |
--no-monorepo | false | Disable automatic monorepo backend detection |
--help, -h | none | Show help |
Examples
Section titled “Examples”# Standard buildnself build
# Validate config only, don't write filesnself build --check
# Force rebuild everything, ignoring cachenself build --force
# CI mode, quiet outputnself build -q
# Show the environment cascade as it loadsnself build --verbose
# Generate a security analysis reportnself build --security-report
# Rebuild for a specific environmentnself build --force --verbose