Docker Setup

View as Markdown

Run the complete IDA platform using Docker Compose.

Prerequisites

ToolVersion
Docker24+
Docker Composev2+
Available RAM8 GB minimum
Disk space10 GB minimum

Quick Start

$git clone https://github.com/infinia/ida.git
$cd ida
$docker compose up -d

docker-compose.yml

1version: '3.8'
2
3services:
4 # ====== ADI Blockchain ======
5 adi-node-1:
6 image: infinia/adi-node:latest
7 container_name: adi-node-1
8 ports:
9 - "30303:30303"
10 - "8545:8545"
11 volumes:
12 - adi-data-1:/data
13 environment:
14 - NETWORK=devnet
15 - NODE_ID=1
16 - VALIDATOR=true
17 networks:
18 - ida-network
19
20 adi-node-2:
21 image: infinia/adi-node:latest
22 container_name: adi-node-2
23 ports:
24 - "30304:30303"
25 - "8546:8545"
26 volumes:
27 - adi-data-2:/data
28 environment:
29 - NETWORK=devnet
30 - NODE_ID=2
31 - VALIDATOR=true
32 - BOOTNODE=adi-node-1:30303
33 depends_on:
34 - adi-node-1
35 networks:
36 - ida-network
37
38 # ====== Infrastructure ======
39 postgres:
40 image: postgres:16-alpine
41 container_name: ida-postgres
42 ports:
43 - "5432:5432"
44 environment:
45 POSTGRES_DB: ida
46 POSTGRES_USER: ida
47 POSTGRES_PASSWORD: ida_secret
48 volumes:
49 - postgres-data:/var/lib/postgresql/data
50 networks:
51 - ida-network
52
53 redis:
54 image: redis:7-alpine
55 container_name: ida-redis
56 ports:
57 - "6379:6379"
58 volumes:
59 - redis-data:/data
60 networks:
61 - ida-network
62
63 nats:
64 image: nats:2.10-alpine
65 container_name: ida-nats
66 ports:
67 - "4222:4222"
68 - "8222:8222"
69 networks:
70 - ida-network
71
72 ipfs:
73 image: ipfs/kubo:latest
74 container_name: ida-ipfs
75 ports:
76 - "5001:5001"
77 - "8088:8080"
78 volumes:
79 - ipfs-data:/data/ipfs
80 networks:
81 - ida-network
82
83 # ====== IDA Services ======
84 ida-api:
85 image: infinia/ida-api:latest
86 container_name: ida-api
87 ports:
88 - "8080:8080"
89 environment:
90 DATABASE_URL: postgres://ida:ida_secret@postgres:5432/ida?sslmode=disable
91 REDIS_URL: redis://redis:6379
92 ADI_RPC_URL: http://adi-node-1:8545
93 NATS_URL: nats://nats:4222
94 IPFS_API_URL: http://ipfs:5001
95 LOG_LEVEL: info
96 depends_on:
97 - postgres
98 - redis
99 - nats
100 - ipfs
101 - adi-node-1
102 networks:
103 - ida-network
104 healthcheck:
105 test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
106 interval: 10s
107 timeout: 5s
108 retries: 5
109
110 ida-resolver:
111 image: infinia/ida-resolver:latest
112 container_name: ida-resolver
113 ports:
114 - "8081:8081"
115 environment:
116 ADI_RPC_URL: http://adi-node-1:8545
117 REDIS_URL: redis://redis:6379
118 IPFS_API_URL: http://ipfs:5001
119 depends_on:
120 - redis
121 - adi-node-1
122 - ipfs
123 networks:
124 - ida-network
125
126 ida-portal:
127 image: infinia/ida-portal:latest
128 container_name: ida-portal
129 ports:
130 - "3000:80"
131 environment:
132 VITE_API_URL: http://localhost:8080
133 depends_on:
134 - ida-api
135 networks:
136 - ida-network
137
138 # ====== Contract Deployer (runs once) ======
139 contract-deployer:
140 image: infinia/ida-contracts:latest
141 container_name: ida-contract-deployer
142 environment:
143 ADI_RPC_URL: http://adi-node-1:8545
144 depends_on:
145 adi-node-1:
146 condition: service_started
147 networks:
148 - ida-network
149 restart: "no"
150
151volumes:
152 adi-data-1:
153 adi-data-2:
154 postgres-data:
155 redis-data:
156 ipfs-data:
157
158networks:
159 ida-network:
160 driver: bridge

Service Ports

ServicePortDescription
ida-api8080IDA Platform API
ida-resolver8081DID Universal Resolver
ida-portal3000Web Portal
adi-node-130303, 8545ADI blockchain node 1
adi-node-230304, 8546ADI blockchain node 2
postgres5432PostgreSQL database
redis6379Redis cache
nats4222NATS message queue
ipfs5001IPFS API

Operations

Start all services

$docker compose up -d

View logs

$docker compose logs -f ida-api
$docker compose logs -f adi-node-1

Stop all services

$docker compose down

Stop and remove all data

$docker compose down -v

Rebuild after code changes

$docker compose build ida-api ida-portal
$docker compose up -d ida-api ida-portal

Health Checks

$# API health
$curl http://localhost:8080/health
$
$# Blockchain sync status
$curl http://localhost:8545 -X POST -H "Content-Type: application/json" \
> -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
$
$# Redis ping
$docker exec ida-redis redis-cli ping
$
$# PostgreSQL status
$docker exec ida-postgres pg_isready

Environment Variables

See Configuration for a full list of environment variables.