Overview
The development configuration is optimized for local development with hot reload, volume mounts, and developer-friendly defaults. All services run in Docker containers with live code reloading enabled.Services Included
The development environment includes five core services:Redis
Self-hosted Redis instance for message streams
Backend
Bun server with tRPC API on port 8084
Frontend
Next.js client application on port 3000
Worker
Bun worker service for processing uptime checks
Publisher
Bun publisher service for publishing website checks to Redis streams
Development Features
Hot Reload
Hot Reload
All services use hot reload:
- Backend, Worker, and Publisher use Bun’s
--hotflag - Frontend uses Next.js dev mode
- Code changes are reflected instantly without container restarts
Volume Mounts
Volume Mounts
Source code is mounted into containers:
- Changes persist across container restarts
- No need to rebuild containers for code changes
- Separate node_modules volumes to prevent conflicts
Development Defaults
Development Defaults
Convenient defaults for local development:
- Default Redis password:
dev-password - Default JWT secret:
dev-secret - Docker network:
better-uptime-network-dev - Redis volume:
redis-data-dev(separate from production)
Environment Setup
Create a.env file in your project root or packages/config/.env:
Quick Start
Start development services
- Build all service images
- Start all containers
- Show logs in your terminal
Access services
Once all services are running:
- Frontend: http://localhost:3000
- Backend: http://localhost:8084
- Redis: localhost:6379
Development Commands
Starting Services
Viewing Logs
Stopping Services
Working with Redis
Troubleshooting
Redis Connection Issues
Redis Connection Issues
If services can’t connect to Redis:
-
Check Redis is healthy:
-
Verify Redis password matches in
.env -
Check network connectivity:
-
View Redis logs:
Build Issues
Build Issues
If builds fail:
-
Clear Docker cache:
- Check Dockerfile paths are correct
- Verify all package.json files exist
- Ensure pnpm-lock.yaml is up to date
Port Conflicts
Port Conflicts
If ports are already in use:
-
Change ports in
.envfile: -
Restart services:
Hot Reload Not Working
Hot Reload Not Working
-
Verify volume mounts:
- Check file permissions on mounted volumes
- Ensure source code is in the correct location
-
Restart the service:
Switching to Production
To switch from development to production:Development and production use separate networks and volumes, so they won’t interfere with each other.
Next Steps
Production Deployment
Deploy Better Uptime to production
Environment Variables
Configure all environment variables
Database Setup
Set up and configure PostgreSQL