Overview
Blnk provides Docker images and Docker Compose configurations for easy deployment. This guide covers both development and production deployments using Docker.Prerequisites
- Docker Engine 20.10 or later
- Docker Compose v2.0 or later
- At least 4GB RAM available for containers
- PostgreSQL 16 client tools (included in Blnk image)
Docker Image
Blnk’s official Docker image is available atjerryenebeli/blnk on Docker Hub.
Image Details
The Blnk image is built using a multi-stage Dockerfile:- Built on Debian Bullseye Slim for stability
- Includes PostgreSQL 16 client for database operations
- Optimized multi-stage build for smaller image size
- Default port: 5001
Docker Compose Setup
Production Deployment
Create adocker-compose.yaml file:
Development Deployment
For local development with hot-reload:Configuration File
Create ablnk.json configuration file in the same directory:
Environment Variables
Create a.env file for environment-specific configurations:
Deployment Commands
Start all services
View logs
Run migrations
Stop services
Stop and remove volumes
Volume Mounts
Configuration Volume
PostgreSQL Data Volume
Typesense Data Volume
Networking
Docker Compose automatically creates a bridge network. Services communicate using service names:server- Blnk API server (port 5001)worker- Background workers (port 5004)postgres- PostgreSQL database (port 5432)redis- Redis cache/queue (port 6379)typesense- Search engine (port 8108)jaeger- Observability (ports 16686, 4317, 4318)
Production Configuration
Resource Limits
Add resource limits to prevent container overconsumption:Security Hardening
- Use secrets for sensitive data:
- Run as non-root user:
- Read-only root filesystem:
Health Checks
Blnk exposes a health endpoint at/health:
Backup Strategy
PostgreSQL Backup
The Blnk image includespg_dump for backups:
Automated Backups
Add a backup service to docker-compose:Troubleshooting
Container Won’t Start
Check logs:Database Connection Issues
Verify PostgreSQL is ready:Port Already in Use
Change the external port mapping:Permission Denied on Volumes
Fix volume permissions:Monitoring
Access monitoring endpoints:- Blnk API: http://localhost:5001
- Health Check: http://localhost:5001/health
- Worker Monitoring: http://localhost:5004
- Jaeger UI: http://localhost:16686
- PostgreSQL: localhost:5432
Next Steps
- Database Setup - Configure PostgreSQL for production
- Redis Setup - Configure Redis clustering
- Production Checklist - Pre-launch checklist