nself build
nself build — ɳSelf documentation.
Generate
docker-compose.yml, nginx configs, and SSL certificates from.env.
Synopsis
nself build [flags]
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.
Flags
| 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) |
--allow-legacy |
false | Bypass v0.9 artifact check and proceed with WARNING (not recommended) |
--no-auto-redis |
false | Disable automatic Redis enablement when a BullMQ-backed plugin is detected |
--profile |
app |
Service profile: app (full service set) or ops (observability + CI server only — excludes minio, mailpit, admin, functions, search) |
--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
# Standard build
nself build
# Validate config only, don't write files
nself build --check
# Force rebuild everything, ignoring cache
nself build --force
# CI mode, quiet output
nself build -q
# Show the environment cascade as it loads
nself build --verbose
# Generate a security analysis report
nself build --security-report
# Rebuild for a specific environment
nself build --force --verbose