nkapp restart
Restart running services.
nkapp restart [services...] [options]Arguments
| Argument | Type | Description |
|---|---|---|
services | string[] | Optional list of service names to restart. If omitted, restarts all services. |
Options
| Flag | Type | Default | Description |
|---|---|---|---|
-e, --env <env> | string | local | Target environment |
Under the Hood
The restart command performs a safe restart depending on the target infrastructure provider:
- Docker (Local/Remote SSH): Performs a native Docker restart (
container.restart()), which is extremely fast and preserves container configurations. - AWS (ECS/EC2): Performs an EC2 instance reboot or triggers an ECS
forceNewDeploymentfor zero-downtime microservice rolling updates. - Fallback: If the provider does not support native restarts, Nanokit falls back to performing a sequential
stopfollowed by astarton the target containers.
Examples
# Restart all services in the local environment
nkapp restart
# Restart specific microservices
nkapp restart api-auth api-gateway
# Restart staging services
nkapp restart -e stage[!NOTE] Like
nkapp start, therestartcommand only operates on existing containers. If you have modified service configurations (like environment variables or ports innanokit.yml), usenkapp upinstead to apply changes and recreate the containers.