Skip to main content

Overview

Docker provides the easiest way to deploy Mirobody Health with all its dependencies in isolated containers.

Quick Deployment

1

Clone repository

git clone https://github.com/thetahealth/mirobody-health.git
cd mirobody-health
2

Configure

cp .env_example .env
cp config.example.yaml config.yaml
# Edit config.yaml with your settings
3

Deploy

./deploy.sh
Or manually:
docker-compose up -d
4

Verify

curl http://localhost:18080/health

Docker Compose Services

The deployment includes three services:
ServicePortDescription
backend18080FastAPI application server
postgres5432PostgreSQL database
redis6379Redis cache and session store

Configuration

Environment Variables

.env
# Database
POSTGRES_USER=holistic_user
POSTGRES_PASSWORD=your_secure_password
POSTGRES_DB=holistic_db

# Redis
REDIS_PASSWORD=your_redis_password

Docker Compose Override

Create docker-compose.override.yml for local customizations:
docker-compose.override.yml
version: '3.8'

services:
  backend:
    environment:
      - LOG_LEVEL=DEBUG
    ports:
      - "18081:18080"  # Custom port

Management Commands

# View logs
docker-compose logs -f backend

# Restart service
docker-compose restart backend

# Stop all services
docker-compose down

# Rebuild containers
docker-compose build --no-cache

# Execute command in container
docker-compose exec backend python -c "print('Hello')"

Data Persistence

Data is persisted in Docker volumes:
  • pgdata: PostgreSQL data
  • redis-data: Redis persistence
# Backup database
docker-compose exec postgres pg_dump -U holistic_user holistic_db > backup.sql

# Restore database
docker-compose exec -T postgres psql -U holistic_user holistic_db < backup.sql

Troubleshooting

Change port in config.yaml or docker-compose.override.yml
Check logs: docker-compose logs backend
Verify PostgreSQL is running: docker-compose ps postgres
For production deployment, see Production Deployment.