Installation
Installation
Section titled “Installation”This guide covers production deployment of Manuscript.
Requirements
Section titled “Requirements”- Go 1.21+ (for building from source)
- Docker (for containerized deployment)
- 128MB RAM minimum
- Any x86_64 or ARM64 architecture
Docker Deployment
Section titled “Docker Deployment”Basic Deployment
Section titled “Basic Deployment”docker run -d \ --name manuscript \ -p 8080:8080 \ --restart unless-stopped \ manuscript/manuscript:latestDocker Compose
Section titled “Docker Compose”Create a docker-compose.yml:
version: '3.8'services: manuscript: image: manuscript/manuscript:latest ports: - "8080:8080" environment: - LOG_LEVEL=info - METRICS_ENABLED=true healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8080/health"] interval: 30s timeout: 10s retries: 3 restart: unless-stoppedThen run:
docker-compose up -dKubernetes Deployment
Section titled “Kubernetes Deployment”apiVersion: apps/v1kind: Deploymentmetadata: name: manuscript labels: app: manuscriptspec: replicas: 3 selector: matchLabels: app: manuscript template: metadata: labels: app: manuscript spec: containers: - name: manuscript image: manuscript/manuscript:latest ports: - containerPort: 8080 resources: requests: cpu: "100m" memory: "128Mi" limits: cpu: "500m" memory: "512Mi" livenessProbe: httpGet: path: /health port: 8080 initialDelaySeconds: 5 periodSeconds: 10 readinessProbe: httpGet: path: /health port: 8080 initialDelaySeconds: 5 periodSeconds: 5---apiVersion: v1kind: Servicemetadata: name: manuscriptspec: selector: app: manuscript ports: - port: 80 targetPort: 8080 type: ClusterIPBuilding from Source
Section titled “Building from Source”# Clone the repositorygit clone https://github.com/vinpatel/manuscript.gitcd manuscript
# Build the binarymake build
# Or build with version infomake build-release
# Run./bin/manuscriptConfiguration
Section titled “Configuration”Manuscript is configured via environment variables:
| Variable | Default | Description |
|---|---|---|
PORT | 8080 | Server port |
HOST | 0.0.0.0 | Bind address |
ENV | development | Environment mode |
LOG_LEVEL | info | Logging verbosity (debug/info/warn/error) |
LOG_FORMAT | json | Log format (json/text) |
METRICS_ENABLED | true | Enable Prometheus metrics |
CORS_ORIGINS | * | Allowed CORS origins |
MAX_TEXT_LENGTH | 100000 | Maximum text length (chars) |
MAX_IMAGE_SIZE | 10MB | Maximum image upload size |
Example with Custom Config
Section titled “Example with Custom Config”docker run -d \ -p 8080:8080 \ -e LOG_LEVEL=debug \ -e METRICS_ENABLED=true \ -e MAX_TEXT_LENGTH=50000 \ manuscript/manuscript:latestMonitoring
Section titled “Monitoring”Prometheus Metrics
Section titled “Prometheus Metrics”Metrics are exposed at /metrics:
curl http://localhost:8080/metricsAvailable metrics:
manuscript_requests_total- Total requests by typemanuscript_request_duration_seconds- Request latency histogrammanuscript_detection_accuracy- Detection accuracy gaugemanuscript_active_requests- Currently processing requests
Grafana Dashboard
Section titled “Grafana Dashboard”Import the provided Grafana dashboard from monitoring/grafana-dashboard.json.
Security Considerations
Section titled “Security Considerations”- Network Isolation - Run behind a reverse proxy
- TLS Termination - Use nginx/traefik for HTTPS
- Rate Limiting - Configure at reverse proxy level
- Authentication - Add auth middleware as needed
Next Steps
Section titled “Next Steps”- API Reference - Full API documentation
- Benchmarks - Performance metrics