Skip to content

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

bash
forge deploy:k8s [OPTIONS]

Options

OptionTypeDefaultDescription
--envstringproductionTarget environment: production, staging, or development.
--domainstringPrimary domain for Ingress configuration.
--sslflagfalseEnable TLS with cert-manager annotations.
--emailstringEmail for Let's Encrypt certificate issuance.
--replicasnumber2Number of pod replicas per service.
--namespacestringProject nameKubernetes namespace.
--registrystringContainer registry URL (e.g. ghcr.io/org).
--outputstringdeploy/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.yaml

Examples

Production deployment with SSL:

bash
forge deploy:k8s \
  --env production \
  --domain myapp.com \
  --ssl \
  --email admin@myapp.com \
  --replicas 3 \
  --registry ghcr.io/myorg

Staging with minimal resources:

bash
forge deploy:k8s \
  --env staging \
  --domain staging.myapp.com \
  --replicas 1

TIP

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

bash
forge deploy:compose [OPTIONS]

Options

OptionTypeDefaultDescription
--envstringproductionTarget environment.
--sslflagfalseEnable SSL with Certbot and Nginx.
--emailstringEmail 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.production

Example

bash
forge deploy:compose --ssl --email admin@myapp.com

forge deploy:scripts

Generate deployment helper scripts for CI/CD pipelines and manual deployments.

Usage

bash
forge deploy:scripts [OPTIONS]

Options

OptionTypeDefaultDescription
--envstringproductionTarget 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 only

Example

bash
forge deploy:scripts --env production

forge deploy:ssl

Generate SSL certificate configuration for production deployments.

Usage

bash
forge deploy:ssl [OPTIONS]

Options

OptionTypeDefaultDescription
--methodstringcertbotSSL provisioning method: certbot.
--domainstringDomain name for the certificate.
--emailstringEmail for Let's Encrypt registration.
--outputstringdeploy/ssl/Output directory.

Example

bash
forge deploy:ssl \
  --domain myapp.com \
  --email admin@myapp.com

TIP

For local development SSL, use forge ssl:generate instead. This command is specifically for production certificate provisioning. See Infrastructure Commands.


See Also

Released under the MIT License.