# Docker Compose Files Guide

## Current Structure (Option A - Template-Based)

**Location**: `docker-compose/docker-compose.template.yml`

This is the **current, recommended** approach using:
- Single template file with profiles
- Environment variables for per-VM customization
- Standardized config files (`config-*.toml`)

### Usage

```bash
# On VM1 (10.1.1.4) - Validator-1 + RPC-Perm
cd /opt/docker-compose
docker compose --profile validator-1 --profile rpc-perm up -d

# On VM2 (10.2.1.4) - Validator-2 + RPC-Core
docker compose --profile validator-2 --profile rpc-core up -d

# On VM3 (10.3.1.4) - Validator-3 + Member-1
docker compose --profile validator-3 --profile member-1 up -d

# On VM4 (10.4.1.4) - Validator-4 + Member-2
docker compose --profile validator-4 --profile member-2 up -d

# On VM5 (10.5.1.4) - RPC-Public
docker compose --profile rpc-public up -d
```

## Legacy Structure

**Location**: `docker/besu-*/docker-compose.yml`

These are **legacy** per-node-type files:
- `docker/besu-validator/docker-compose.yml` - Old validator setup
- `docker/besu-sentry/docker-compose.yml` - Old sentry setup
- `docker/besu-rpc/docker-compose.yml` - Old RPC setup

**Status**: Kept for reference, but not actively used. May be removed in future cleanup.

## Phase 2 Regional Deployments

**Location**: `docker/phase2/docker-compose.*.yml`

Regional deployment files:
- `docker-compose.eus.yml` - East US
- `docker-compose.wus.yml` - West US
- `docker-compose.cus.yml` - Central US
- `docker-compose.eus2.yml` - East US 2
- `docker-compose.wus2.yml` - West US 2
- `docker-compose-blockscout.yml` - Blockscout explorer

**Status**: Active for Phase 2 deployments.

## Migration Notes

If you're migrating from the old structure:
1. Use the new `docker-compose/docker-compose.template.yml`
2. Copy the appropriate `.env` file from `docker-compose/env/`
3. Use profiles to start only the services needed for each VM
4. Old configs are archived in `docs/archive/old-configs/ibft2/`
