fastapi-deployment-config
Configure multi-platform deployment for FastAPI applications including Docker containerization, Railway, DigitalOcean App Platform, and AWS deployment. Use when deploying FastAPI apps, setting up production environments, containerizing applications, configuring cloud platforms, implementing health checks, managing environment variables, setting up reverse proxies, or when user mentions Docker, Railway, DigitalOcean, AWS, deployment configuration, production setup, or container orchestration.
What this skill does
# FastAPI Deployment Configuration
**Purpose:** Autonomously configure and deploy FastAPI applications across multiple platforms with production-ready configurations.
**Activation Triggers:**
- Deployment setup requests
- Docker containerization needs
- Platform-specific configuration (Railway, DigitalOcean, AWS)
- Health check implementation
- Environment variable management
- Reverse proxy setup (Nginx)
- Production optimization
- Multi-stage build configurations
**Key Resources:**
- `scripts/build-docker.sh` - Multi-stage Docker build automation
- `scripts/validate-deployment.sh` - Pre-deployment validation checks
- `scripts/health-check.sh` - Application health verification
- `templates/` - Production-ready Dockerfile, docker-compose.yml, platform configs
- `examples/` - Platform-specific deployment guides (Railway, DigitalOcean, AWS)
## Deployment Workflow
### 1. Pre-Deployment Validation
Run comprehensive checks before deployment:
```bash
./scripts/validate-deployment.sh
# Validates:
# - Python dependencies (requirements.txt)
# - Environment variables (.env.example)
# - FastAPI application structure
# - Database migrations (if using Alembic)
# - Static file configuration
# - CORS settings
# - Security configurations
```
**Common issues detected:**
- Missing required dependencies
- Unset environment variables
- Database connection configuration
- Missing CORS origins
- Insecure secret key defaults
### 2. Docker Containerization
Build optimized Docker image using multi-stage builds:
```bash
./scripts/build-docker.sh [--platform=linux/amd64] [--tag=myapp:latest]
# Features:
# - Multi-stage build (builder + runtime)
# - Layer caching optimization
# - Non-root user for security
# - Health check integration
# - Minimal production image size
```
**Dockerfile template** (`templates/Dockerfile`):
- Python 3.11+ slim base image
- Virtual environment isolation
- Production dependency separation
- Gunicorn/Uvicorn workers
- Security best practices
### 3. Platform-Specific Configuration
#### Railway Deployment
```bash
# Railway uses railway.json for configuration
# See: examples/railway_setup.md
# Key features:
# - Automatic HTTPS
# - Environment variable management
# - Auto-deploy from Git
# - Database provisioning
# - Custom domains
```
**Configuration:** `templates/railway.json`
- Build command: `pip install -r requirements.txt`
- Start command: `uvicorn main:app --host 0.0.0.0 --port $PORT`
- Health check endpoint: `/health`
#### DigitalOcean App Platform
```bash
# DigitalOcean uses app.yaml for configuration
# See: examples/digitalocean_setup.md
# Key features:
# - Container registry integration
# - Managed databases
# - Auto-scaling
# - CDN integration
# - Monitoring & alerts
```
**Configuration:** `templates/digitalocean-app.yaml`
- Dockerfile-based deployment
- Health check configuration
- Environment variable secrets
- Database component linking
#### AWS Deployment Options
**ECS (Elastic Container Service):**
```bash
# See: examples/aws_setup.md#ecs-deployment
# Features:
# - Fargate serverless containers
# - Load balancer integration
# - Auto-scaling policies
# - CloudWatch logging
# - VPC networking
```
**App Runner:**
```bash
# Simplified container deployment
# Automatic scaling and load balancing
# See: examples/aws_setup.md#app-runner
```
### 4. Health Check Implementation
Implement comprehensive health checks:
```bash
./scripts/health-check.sh <endpoint-url>
# Checks:
# - HTTP endpoint availability (GET /health)
# - Database connectivity
# - Redis/cache availability
# - External API dependencies
# - Response time monitoring
```
**Health endpoint template:**
```python
@app.get("/health")
async def health_check():
return {
"status": "healthy",
"version": "1.0.0",
"database": check_db(),
"cache": check_redis()
}
```
### 5. Environment Variable Management
**Required environment variables:**
- `DATABASE_URL` - Database connection string
- `SECRET_KEY` - Application secret key
- `CORS_ORIGINS` - Allowed CORS origins
- `ENVIRONMENT` - prod/staging/dev
- `LOG_LEVEL` - Logging verbosity
**Templates provided:**
- `.env.example` - Development template
- `.env.production.example` - Production template
### 6. Reverse Proxy Configuration (Nginx)
For self-hosted deployments:
```bash
# Nginx configuration: templates/nginx.conf
# Features:
# - SSL/TLS termination
# - Rate limiting
# - Request buffering
# - Gzip compression
# - Static file serving
# - WebSocket support
# - Security headers
```
**Configuration highlights:**
- Proxy to Uvicorn on port 8000
- Client max body size: 10M
- Connection timeout: 60s
- Rate limiting: 100 req/min per IP
## Docker Compose Orchestration
For local development and testing:
```bash
docker-compose up -d
# Services configured:
# - FastAPI application
# - PostgreSQL database
# - Redis cache
# - Nginx reverse proxy
```
**Template:** `templates/docker-compose.yml`
- Volume mounts for development
- Network isolation
- Health check dependencies
- Environment variable injection
## Production Optimization
### Multi-Stage Docker Build
**Stage 1: Builder**
- Install all dependencies
- Compile Python packages
- Create virtual environment
**Stage 2: Runtime**
- Copy only runtime dependencies
- Non-root user execution
- Minimal attack surface
- Optimized layer caching
### Worker Configuration
**Gunicorn + Uvicorn:**
```bash
# Recommended workers: (2 x CPU cores) + 1
gunicorn main:app \
--workers 4 \
--worker-class uvicorn.workers.UvicornWorker \
--bind 0.0.0.0:8000 \
--access-logfile - \
--error-logfile - \
--log-level info
```
### Database Connection Pooling
```python
# SQLAlchemy configuration
engine = create_engine(
DATABASE_URL,
pool_size=10,
max_overflow=20,
pool_pre_ping=True
)
```
## Security Configurations
**Implemented in templates:**
- ✅ Non-root Docker user
- ✅ Read-only root filesystem (where possible)
- ✅ Security headers (HSTS, X-Frame-Options, CSP)
- ✅ CORS configuration
- ✅ Rate limiting
- ✅ Secret management via environment variables
- ✅ SQL injection prevention (SQLAlchemy ORM)
- ✅ Input validation (Pydantic models)
## Platform Comparison
| Feature | Railway | DigitalOcean | AWS ECS | AWS App Runner |
|---------|---------|--------------|---------|----------------|
| **Ease of Setup** | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐ |
| **Cost (Low Traffic)** | $5-10/mo | $12/mo | $20-30/mo | $15-25/mo |
| **Auto-Scaling** | Limited | Yes | Yes | Yes |
| **Database Included** | Yes (add-on) | Yes (managed) | Separate (RDS) | Separate (RDS) |
| **Custom Domains** | Yes | Yes | Yes | Yes |
| **CI/CD** | Git-based | Container registry | CodePipeline | Git/ECR |
## Common Deployment Scenarios
### Scenario 1: Simple API (No Database)
**Recommended:** Railway or AWS App Runner
- Minimal configuration
- Fast deployment
- Auto-scaling included
### Scenario 2: API + PostgreSQL
**Recommended:** Railway or DigitalOcean
- Integrated database provisioning
- Automatic backups
- Connection pooling
### Scenario 3: Microservices Architecture
**Recommended:** AWS ECS or DigitalOcean App Platform
- Service mesh capabilities
- Container orchestration
- Advanced networking
### Scenario 4: High-Traffic Production
**Recommended:** AWS ECS with RDS
- Advanced monitoring
- Multi-AZ deployment
- Enterprise support
## Troubleshooting
### Build Failures
```bash
# Check Docker build logs
./scripts/build-docker.sh --verbose
# Common fixes:
# - Update requirements.txt versions
# - Check Python version compatibility
# - Verify base image availability
```
### Health Check Failures
```bash
# Debug health endpoint
./scripts/health-check.sh http://localhost:8000/health --debug
# Common issues:
# - Database connection timeout
# - Missing environment variables
# - Port binding conflicts
```
### Performance Issues
```bash
# Monitor worker utilization
# Increase Gunicorn workers
# Enable connection pooling
# Implement caching (Redis)
# Optimize dRelated in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.