Overview
The BE Monorepo uses Docker Compose to manage development infrastructure services including PostgreSQL, Redis, and OpenTelemetry observability stack.Docker Compose Configuration
The Docker setup is located in thedocker/ directory and includes three core services:
Services
PostgreSQL Database
PostgreSQL 17 is used as the primary database:Redis Cache
Redis is used for caching and session management:Grafana LGTM Stack (Observability)
Integrated Loki, Grafana, Tempo, and Mimir (LGTM) stack for observability:Data Persistence
Docker volumes ensure data persistence across container restarts:Starting Services
Using npm/bun Scripts
The recommended way to start all services:package.json:
Manual Docker Compose
You can also run Docker Compose manually:Environment Configuration
Create a.env file in the docker/ directory for the observability stack. See .env.example for reference.
For the Hono application, configure the database connection in apps/hono/.env.dev or apps/hono/.env.prod:
Service Health Checks
Verify services are running:Port Mapping
| Service | Container Port | Host Port | Purpose |
|---|---|---|---|
| PostgreSQL | 5432 | 5432 | Database connection |
| Redis | 6379 | 6379 | Cache connection |
| Grafana | 3000 | 3111 | Observability UI |
| OTLP gRPC | 4317 | 4317 | OpenTelemetry gRPC |
| OTLP HTTP | 4318 | 4318 | OpenTelemetry HTTP |
Troubleshooting
Port Conflicts
If ports are already in use, modify the port mappings indocker-compose.yml:
Volume Permissions
Ensure the container directories have proper permissions:Reset Database
To completely reset the database:Production Considerations
Next Steps
Production Build
Learn about building the application for production
CI/CD
Set up continuous integration and deployment
