# Clone and configure
git clone https://github.com/TheDeveloperDen/DevBin.git
cd DevBin
cp .env.example .env
# Required: Edit .env with production valuesThen triggering docker compose manually
(you maybe required replacing docker compose with docker-compose)
# Start services
docker compose -f docker-compose.prod.yml up -d
# Run migrations
docker compose -f docker-compose.prod.yml run --rm app uv run alembic upgrade headOr with Taskfile:
task prod:up
task db:migrateIf not set, DevBin will not be secure and do not open an issue reporting any security problems if those below are not set
- Strong database credentials (
POSTGRES_USER,POSTGRES_PASSWORD) -
APP_DEBUG=false -
APP_RELOAD=false - Configure
APP_TRUSTED_HOSTS
Note: Your reverse proxy IPs from the frontend, if on docker it can be the containers name, for example
["devbin_frontend"]otherwise specify the ip of the frontend server
- Set specific
APP_CORS_DOMAINS(no wildcards) - Set
APP_ALLOW_CORS_WILDCARD=false - Generate secure
APP_BYPASS_TOKENif needed, if empty no bypass token will be used - Set
APP_METRICS_TOKENfor Prometheus endpoint (Required, otherwise public)
- Set
APP_WORKERSbased on your required performance for your use case. (true=Uses CPU cores count) - Configure
APP_CACHE_TTLappropriately - Consider Redis for caching (
APP_CACHE_TYPE=redis) at scale - Consider Redis for locking (
APP_LOCK_TYPE=redis) for multi-instance
- Set
APP_MIN_STORAGE_MBfor disk space monitoring - For multi-instance: use S3 or MinIO (
APP_STORAGE_TYPE) - Configure compression settings for storage efficiency
- Set
APP_LOG_LEVEL=INFOorWARNING - Use
APP_LOG_FORMAT=jsonfor log aggregation
Default configuration works out of the box. Increase APP_WORKERS as needed.
For horizontal scaling:
-
Storage: Switch to S3 or MinIO
APP_STORAGE_TYPE=s3 APP_S3_BUCKET_NAME=devbin-pastes APP_S3_REGION=us-east-1 APP_S3_ACCESS_KEY=... APP_S3_SECRET_KEY=...
-
Caching: Use Redis
APP_CACHE_TYPE=redis APP_REDIS_HOST=redis.example.com
-
Locking: Use Redis
APP_LOCK_TYPE=redis
When behind nginx, traefik, or similar:
APP_ENFORCE_HTTPS=false # Let proxy handle SSL
APP_TRUSTED_HOSTS=["10.0.0.0/8", "172.16.0.0/12"] # Proxy IPs (configure for your setup)- Health endpoint:
GET /health - Ready endpoint:
GET /ready(if you are running load balancers ) - Metrics endpoint:
GET /metrics(protected byAPP_METRICS_TOKEN)
docker compose -f docker-compose.prod.yml downOr: task prod:down