Skip to content

Latest commit

 

History

History
72 lines (54 loc) · 1.61 KB

deployment.md

File metadata and controls

72 lines (54 loc) · 1.61 KB

ForgeGateway Deployment Guide

Quick Start

Using Docker Compose (Recommended)

  1. Copy the example configuration:

    cp config.toml.example config.toml
  2. Edit config.toml with your ForgeCode API credentials:

    [forge_api]
    base_url = "https://api.forgecode.com"
    auth_token = "your-actual-token"
  3. Start the service:

    docker-compose up -d
  4. Verify the service is running:

    curl http://localhost:8080/health

Manual Build & Run

  1. Build the application:

    cargo build --release
  2. Create a configuration file:

    cp config.toml.example config.toml
    # Edit config.toml with your settings
  3. Run the application:

    FORGE_CONFIG_PATH=./config.toml ./target/release/forge-gateway

Environment Variables

  • FORGE_CONFIG_PATH: Path to configuration file (default: ./config.toml)
  • RUST_LOG: Logging level (default: info)

Health Check

The service provides a health endpoint at /health that returns:

  • 200 OK when service is healthy
  • 503 Service Unavailable when service is unhealthy

Monitoring

The service includes:

  • Structured JSON logging
  • Health check endpoint
  • Rate limiting (1000 requests/minute)
  • CORS support for web applications

Production Considerations

  1. Security: Set proper CORS origins and rate limits
  2. Authentication: Use environment variables for API tokens
  3. Monitoring: Set up log aggregation and alerting
  4. Scaling: Use load balancer for multiple instances
  5. Backup: Regularly backup configuration and data volumes