mirror of
https://github.com/aykhans/bsky-feedgen.git
synced 2025-11-29 18:49:52 +00:00
Example Production Deployment
This is an example of a production deployment for the Feed Generator.
Architecture
The production setup includes the following services:
- MongoDB: Database for storing posts and feed data
- Consumer: Service that consumes AT Protocol firehose data
- Feed Generator (AZ): Generates feeds for Azerbaijan-related content
- API: REST API service for serving feeds
- Caddy: Reverse proxy
Quick Start
-
Configure the environment:
make configureThis will:
- Copy all example configuration files
- Prompt for MongoDB credentials
- Prompt for domain name and AT Protocol DID
- Update configuration files with your values
-
Start the services:
docker compose up -d -
Check service status:
docker compose ps docker compose logs
Configuration Files
Application Configuration
config/app/.api.env- API service configurationconfig/app/.consumer.env- Consumer service configurationconfig/app/.mongodb.env- MongoDB connection settingsconfig/app/feedgen/.az.env- Azerbaijan feed generator settings
Infrastructure Configuration
config/caddy/.env- Caddy reverse proxy settingsconfig/caddy/Caddyfile- Caddy server configurationconfig/mongodb/.env- MongoDB initialization settings
Environment Variables
API Service
FEEDGEN_HOSTNAME- Public hostname for the feed generatorFEEDGEN_PUBLISHER_DID- Your AT Protocol DIDAPI_PORT- Port for the API service (default: 8421)
Consumer Service
POST_MAX_DATE- Maximum age of posts to store (default: 720h/30 days)POST_COLLECTION_CUTOFF_CRON_DELAY- Cleanup interval (default: 30m)POST_COLLECTION_CUTOFF_CRON_MAX_DOCUMENT- Max documents before cleanup (default: 1M)
AZ Feed Generator
FEED_AZ_GENERATER_CRON_DELAY- Feed generation interval (default: 1m)FEED_AZ_COLLECTION_CUTOFF_CRON_DELAY- Cleanup interval (default: 30m)FEED_AZ_COLLECTION_CUTOFF_CRON_MAX_DOCUMENT- Max documents before cleanup (default: 500K)
MongoDB
MONGODB_HOST- MongoDB hostname (default: mongodb)MONGODB_PORT- MongoDB port (default: 27017)MONGODB_USERNAME- Database usernameMONGODB_PASSWORD- Database password
Caddy
DOMAIN- Your domain nameAPI_HOST- Internal API service URL (default: http://api:8421)