DocumentationFauxDB Documentation
FauxDB Docker Setup
Prerequisites
Before starting, ensure you have:
- Docker 20.10+ installed
- Docker Compose 2.0+
- 2GB+ RAM available
- 5GB+ disk space
- Ports 27018, 5432, 9090 available
Quick Start
Get FauxDB running with Docker in minutes.
Clone and setup
# Clone the repository
git clone https://github.com/pgElephant/fauxdb.git
cd fauxdb
# Copy environment configuration
cp docker/config/docker.env.example .env
# Edit configuration (optional)
nano .envStart FauxDB
# Quick setup and start
make setup
docker-compose up -d
# Check service status
docker-compose ps
# View logs
docker-compose logs -f fauxdbTest MongoDB connection
# Connect with mongosh
mongosh mongodb://localhost:27018
# Test basic operations
use testdb
db.runCommand({ping: 1})
db.test.insertOne({message: "Hello FauxDB!"})
db.test.find()Docker Compose Configuration
Complete docker-compose.yml configuration for FauxDB.
docker-compose.yml
version: '3.8'
services:
postgres:
image: postgres:17
environment:
POSTGRES_DB: fauxdb
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./docker/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
networks:
- fauxdb-network
fauxdb:
build: .
ports:
- "27018:27018"
- "9090:9090"
environment:
- DATABASE_URL=postgresql://postgres:postgres@postgres:5432/fauxdb
- FAUXDB_PORT=27018
- FAUXDB_MAX_CONNECTIONS=1000
depends_on:
- postgres
volumes:
- ./config:/app/config
networks:
- fauxdb-network
volumes:
postgres_data:
networks:
fauxdb-network:
driver: bridgeEnvironment Variables (.env)
# PostgreSQL Configuration
POSTGRES_USER=postgres
POSTGRES_PASSWORD=your_secure_password
POSTGRES_DB=fauxdb_prod
# FauxDB Server
FAUXDB_PORT=27018
FAUXDB_MAX_CONNECTIONS=1000
FAUXDB_WORKER_THREADS=4
# Security
FAUXDB_ENABLE_SSL=false
FAUXDB_ENABLE_AUTH=false
# Monitoring
GRAFANA_PASSWORD=admin123Development Environment
Hot reload development setup for FauxDB.
Development commands
# Start development environment
make dev
# View development logs
make dev-logs
# Open shell in container
make dev-shell
# Stop development environment
make dev-stopProduction Environment
Production-ready Docker deployment with monitoring.
Production commands
# Start production environment
make prod
# Start with monitoring stack
make monitor
# View production logs
make prod-logsMonitoring Setup
Prometheus metrics and health checks.
Access metrics
# Access metrics endpoint
curl http://localhost:9090/metrics
# Key metrics:
# - fauxdb_operations_total
# - fauxdb_operation_duration_seconds
# - fauxdb_connections_active
# - fauxdb_transactions_totalHealth checks
# Basic health check
curl http://localhost:9090/health
# Detailed status
curl http://localhost:9090/status
# Database connectivity
curl http://localhost:9090/db/healthTroubleshooting
Common Docker deployment issues and solutions.
Container won't start
Check logs and ports
# Check logs
docker-compose logs fauxdb
# Check port conflicts
netstat -tulpn | grep :27018Database connection failed
Verify PostgreSQL
# Check PostgreSQL status
docker-compose exec postgres psql -U postgres -c "SELECT version();"
# Check connection string
docker-compose exec fauxdb env | grep DATABASE_URLMongoDB client can't connect
Test connection
# Test connection
mongosh mongodb://localhost:27018 --eval "db.runCommand({ping: 1})"
# Check FauxDB status
curl http://localhost:9090/healthNext Steps
- Configuration Guide - Advanced configuration options
- Monitoring Setup - Comprehensive monitoring with Grafana
- Production Deployment - Production best practices