Overview
Macro uses Docker Compose to run all services locally, providing a complete development environment that mirrors production infrastructure.Architecture
The Docker setup is split across multiple compose files:docker-compose.yml- Main application servicesdocker-compose-databases.yml- Database services (PostgreSQL, Redis, OpenSearch)infra/stacks/fusionauth-instance/docker-compose.yml- FusionAuth authentication
Prerequisites
- Docker and Docker Compose
- Just (command runner)
- Doppler (for secrets management)
- AWS CLI (for credentials)
- SQLX CLI (for database migrations)
Initial Setup
1. Export SOPS KMS ARN
2. Run Setup
- Decrypt and prepare environment variables (
.env) - Create Docker networks (
databases,auth) - Setup LocalStack for AWS emulation
- Initialize local databases
- Setup FusionAuth
- Build development service images
Docker Networks
Three Docker networks connect services:databases- For database connectionsauth- For FusionAuthservices- For inter-service communication
Database Services
PostgreSQL
Redis
- Redis Stack includes RedisJSON, RedisSearch, RedisGraph
- Web UI available at http://localhost:8001
OpenSearch
- Single-node cluster
- Security disabled for local development
- 512MB JVM heap
- Admin password:
yourStrongPassword123!
Running Databases Only
Application Services
All services are built fromrust/cloud-storage with different targets:
Core Services
authentication-service (Port 8080)Processing Services
document_cognition_service (Port 8085)Gateway and Connection Services
connection_gateway (Port 8082)File Services
static_file_service (Port 8094)Utility Services
contacts_service (Port 8083)Sync and Conversion Services
sync_service (Port 8787)Running Services Locally
Start All Services
- Create Docker networks
- Start all services defined in docker-compose files
Start with Rebuild
If you’ve updated code and need fresh images:Start Specific Services
Stop Services
Health Checks
All services include health checks:Environment Variables
Services use a common environment configuration:common-env anchor.
Get Environment File
Database Management
Initialize Databases
- Start databases in detached mode
- Create MacroDB
- Run migrations
- Stop databases
Individual Database Setup
Docker Cache Management
Clear All Build Cache
Clear Rust Target Cache Only
Check Cache Usage
FusionAuth Setup
Start FusionAuth
- Create Docker networks
- Start FusionAuth containers
- Wait for healthy status
- Run Pulumi configuration
Stop FusionAuth
LocalStack
AWS service emulation for local development:- S3
- SQS
- Lambda
- DynamoDB
- Secrets Manager
Troubleshooting
Service Won’t Start
-
Check logs:
-
Verify dependencies are healthy:
-
Rebuild images:
Database Connection Issues
-
Ensure databases are running:
-
Check migrations are applied:
-
Verify
.envfile has correct credentials
Port Conflicts
If ports are already in use:- Stop conflicting services
- Or modify port mappings in
docker-compose.yml