Deployment Guide
Deploy ConstellationAPI to production using Docker or AWS ECS Fargate.
Docker Deployment
Build Image
docker build -t constellation-api .
Run Container
docker run -p 3007:3007 \
-e APIDECK_API_KEY=your_key \
-e APIDECK_APP_ID=your_app_id \
-e INTERNAL_API_KEY=your_internal_key \
-v $(pwd)/data:/app/data \
constellation-api
Docker Compose
docker-compose up -d
AWS ECS Fargate Deployment
Prerequisites
- AWS CLI configured
- Terraform >= 1.0.0
- Docker
Step 1: Set Up AWS Secrets
Use the setup script:
chmod +x scripts/setup-aws-secrets.sh
./scripts/setup-aws-secrets.sh
Or manually create SSM parameters:
aws ssm put-parameter \
--name "/constellation/APIDECK_API_KEY" \
--value "your-api-key" \
--type "SecureString"
aws ssm put-parameter \
--name "/constellation/APIDECK_APP_ID" \
--value "your-app-id" \
--type "SecureString"
aws ssm put-parameter \
--name "/constellation/INTERNAL_API_KEY" \
--value "your-internal-key" \
--type "SecureString"
Step 2: Configure Terraform
Infrastructure is under the repo root infra/ (single deployment root for Orbie Planet). Use the environment you need (e.g. staging):
cd infra/environments/staging # or infra/environments/dev from repo root
cp terraform.tfvars.example terraform.tfvars
# Edit terraform.tfvars with your values
Step 3: Deploy
terraform init
terraform plan
terraform apply
Step 4: Update Container Image
After building and pushing a new image:
aws ecs update-service \
--cluster constellation-cluster \
--service constellation-api-service \
--force-new-deployment
Environment Variables
| Variable | Description | Required |
|---|---|---|
APIDECK_API_KEY | Apideck API key | Yes |
APIDECK_APP_ID | Apideck application ID | Yes |
INTERNAL_API_KEY | Internal API key | Yes |
PORT | Server port | No (default: 3007) |
NODE_ENV | Environment | No |
LOG_LEVEL | Logging level | No |
Monitoring
Health Checks
Configure health checks at /health endpoint.
Metrics
Prometheus metrics available at /metrics.
Logs
- Docker: View with
docker logs - ECS: CloudWatch Log Groups
Scaling
Horizontal Scaling
- ECS: Increase task count
- Docker: Use load balancer with multiple containers
Vertical Scaling
- Increase CPU/memory allocation in ECS task definition
Security
- HTTPS: Use ALB with SSL certificate
- Secrets: Store in AWS SSM Parameter Store
- Network: Use private subnets for ECS tasks
- API Keys: Rotate regularly