Deployment Commands
Deployment commands generate production-ready infrastructure configurations and automate the release process. FORGE supports Kubernetes, Docker Compose, and direct SSH deployments.
forge deploy:k8s
Generate Kubernetes manifests for deploying your FORGE application to a cluster.
Usage
forge deploy:k8s [OPTIONS]Options
| Option | Type | Default | Description |
|---|---|---|---|
--env | string | production | Target environment: production, staging, or development. |
--domain | string | — | Primary domain for Ingress configuration. |
--ssl | flag | false | Enable TLS with cert-manager annotations. |
--email | string | — | Email for Let's Encrypt certificate issuance. |
--replicas | number | 2 | Number of pod replicas per service. |
--namespace | string | Project name | Kubernetes namespace. |
--registry | string | — | Container registry URL (e.g. ghcr.io/org). |
--output | string | deploy/k8s/ | Output directory for generated manifests. |
Generated File Structure
deploy/k8s/
namespace.yaml
configmap.yaml
secrets.yaml
api/
deployment.yaml
service.yaml
hpa.yaml
web/
deployment.yaml
service.yaml
hpa.yaml
admin/
deployment.yaml
service.yaml
hpa.yaml
ingress.yaml
cert-manager/
cluster-issuer.yaml
certificate.yaml
postgres/
statefulset.yaml
service.yaml
pvc.yaml
redis/
deployment.yaml
service.yamlExamples
Production deployment with SSL:
forge deploy:k8s \
--env production \
--domain myapp.com \
--ssl \
--email admin@myapp.com \
--replicas 3 \
--registry ghcr.io/myorgStaging with minimal resources:
forge deploy:k8s \
--env staging \
--domain staging.myapp.com \
--replicas 1TIP
Generated manifests use Kustomize-compatible structure. You can layer environment-specific overrides on top of the base configuration.
forge deploy:compose
Generate a production-grade Docker Compose file with Nginx reverse proxy and optional SSL.
Usage
forge deploy:compose [OPTIONS]Options
| Option | Type | Default | Description |
|---|---|---|---|
--env | string | production | Target environment. |
--ssl | flag | false | Enable SSL with Certbot and Nginx. |
--email | string | — | Email for Let's Encrypt certificate issuance. |
Generated File Structure
deploy/compose/
docker-compose.production.yml
nginx/
nginx.conf
conf.d/
api.conf
web.conf
admin.conf
certbot/
cli.ini
.env.productionExample
forge deploy:compose --ssl --email admin@myapp.comforge deploy:scripts
Generate deployment helper scripts for CI/CD pipelines and manual deployments.
Usage
forge deploy:scripts [OPTIONS]Options
| Option | Type | Default | Description |
|---|---|---|---|
--env | string | production | Target environment. |
Generated Files
deploy/scripts/
deploy.sh # Full deployment script
rollback.sh # Rollback to previous release
health-check.sh # Verify services are healthy
backup-db.sh # Database backup before deploy
migrate.sh # Run migrations onlyExample
forge deploy:scripts --env productionforge deploy:ssl
Generate SSL certificate configuration for production deployments.
Usage
forge deploy:ssl [OPTIONS]Options
| Option | Type | Default | Description |
|---|---|---|---|
--method | string | certbot | SSL provisioning method: certbot. |
--domain | string | — | Domain name for the certificate. |
--email | string | — | Email for Let's Encrypt registration. |
--output | string | deploy/ssl/ | Output directory. |
Example
forge deploy:ssl \
--domain myapp.com \
--email admin@myapp.comTIP
For local development SSL, use forge ssl:generate instead. This command is specifically for production certificate provisioning. See Infrastructure Commands.
See Also
- Infrastructure Commands — local Docker, SSL, and hosts management
- Database Commands — migration strategies for deployment
- Validation Commands — validate before deploying