Deployment
Docker, reverse proxy setup, and environment variable reference.
Docker
# Build docker build -t stackr:latest . # Run docker run --rm -p 3000:3000 --env-file .env stackr:latest # Or use docker-compose docker-compose up -d
Reverse Proxy
Terminate TLS at a reverse proxy. Set TRUSTED_PROXY_IPS to the proxy's IP.
Caddyfile
stackr.example.com {
reverse_proxy localhost:3000
}Environment Variables
| Variable | Default | Description |
|---|---|---|
HOST | 0.0.0.0 | Listen address |
PORT | 3000 | Listen port |
ENVIRONMENT | development | development | staging | production |
DATABASE_URL | — | Postgres connection string |
REDIS_URL | redis://127.0.0.1:6379 | Redis connection string |
STELLAR_HORIZON_URL | testnet | Horizon API endpoint |
FEE_PAYER_SECRET | — | Stellar account that pays fees and funds new accounts |
USDC_ASSET_CODE | USDC | Asset code on Stellar |
USDC_ISSUER | testnet issuer | USDC issuer account |
WALLET_MASTER_SEED | — | Master seed for wallet derivation (CRITICAL) |
WALLET_ENCRYPTION_KEY | — | 64 hex chars for AES-256-GCM |
FIAT_CURRENCY | RWF | Local fiat currency code |
FIAT_COUNTRY | RW | Country code for Airbills API |
ANCHOR_DOMAIN | — | SEP-24 anchor domain |
WEBHOOK_SECRET | — | Anchor webhook authentication |
INTERNAL_API_KEY | — | API v1 authentication key |
Troubleshooting
"Address already in use"
Another process on port 3000. Kill it: lsof -ti :3000 | xargs kill
"DATABASE_URL required"
.env file missing or not loaded. Ensure it's in the project root.
"WALLET_ENCRYPTION_KEY must be exactly 64 hex characters"
Generate one: openssl rand -hex 32
Stellar "op_src_no_trust"
User doesn't have a USDC trustline. Account wasn't funded during registration.
Exchange rate errors
CoinGecko rate limits on free tier. The 60-second Redis cache minimizes API calls.