forked from Provable-Games/governance
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
75 lines (70 loc) · 2 KB
/
docker-compose.yml
File metadata and controls
75 lines (70 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
version: "3.8"
services:
# PostgreSQL for governance data
db:
image: postgres:15-alpine
container_name: db
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: ${GOVERNANCE_DB:-sepolia}
ports:
- "${GOVERNANCE_DB_PORT:-5432}:5432"
volumes:
- db-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
networks:
- network
# Governance indexer
indexer:
build:
context: ./indexer
dockerfile: Dockerfile
container_name: indexer
depends_on:
db:
condition: service_healthy
environment:
- NETWORK=${NETWORK:-sepolia}
- PG_CONNECTION_STRING=postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@db:5432/${GOVERNANCE_DB:-sepolia}
- APIBARA_URL=${APIBARA_URL}
- DNA_TOKEN=${DNA_TOKEN}
- GOVERNOR_ADDRESS=${GOVERNOR_ADDRESS}
- VOTES_TOKEN_ADDRESS=${VOTES_TOKEN_ADDRESS}
- STARTING_CURSOR_BLOCK_NUMBER=${STARTING_CURSOR_BLOCK_NUMBER:-0}
- LOG_LEVEL=${LOG_LEVEL:-info}
- NO_BLOCKS_TIMEOUT_MS=${NO_BLOCKS_TIMEOUT_MS:-0}
restart: unless-stopped
networks:
- network
# Governance API
api:
build:
context: ./api
dockerfile: Dockerfile
container_name: api
environment:
PORT: 4000
GOVERNANCE_DB_URL: postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@db:5432/${GOVERNANCE_DB:-sepolia}
CORS_ORIGIN: ${CORS_ORIGIN:-*}
CACHE_TTL_PROPOSALS: ${CACHE_TTL_PROPOSALS:-120}
CACHE_TTL_VOTES: ${CACHE_TTL_VOTES:-60}
CACHE_TTL_DELEGATES: ${CACHE_TTL_DELEGATES:-300}
ports:
- "${API_PORT:-4000}:4000"
depends_on:
db:
condition: service_healthy
restart: unless-stopped
networks:
- network
volumes:
db-data:
networks:
network:
driver: bridge