forked from paritytech/jamtart
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
144 lines (140 loc) · 3.82 KB
/
docker-compose.yml
File metadata and controls
144 lines (140 loc) · 3.82 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
services:
# TimescaleDB database
postgres:
image: timescale/timescaledb:latest-pg17
container_name: tart-timescaledb
shm_size: 512mb
environment:
# WARNING: Default credentials for LOCAL DEVELOPMENT only
# For production, override these with strong passwords via environment variables or secrets
- POSTGRES_USER=${POSTGRES_USER:-tart}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-tart_password}
- POSTGRES_DB=${POSTGRES_DB:-tart_telemetry}
- POSTGRES_INITDB_ARGS=-E UTF8 --locale=C
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
command:
- postgres
- -c
- shared_buffers=256MB
- -c
- max_connections=250
- -c
- effective_cache_size=1GB
- -c
- maintenance_work_mem=128MB
- -c
- checkpoint_completion_target=0.95
- -c
- wal_buffers=16MB
- -c
- default_statistics_target=100
- -c
- random_page_cost=1.0
- -c
- effective_io_concurrency=200
- -c
- work_mem=16MB
- -c
- min_wal_size=2GB
- -c
- max_wal_size=8GB
- -c
- synchronous_commit=local
- -c
- statement_timeout=30000
- -c
- idle_in_transaction_session_timeout=30000
- -c
- autovacuum_vacuum_cost_delay=2
- -c
- autovacuum_vacuum_cost_limit=1000
- -c
- jit=on
- -c
- log_min_duration_statement=1000
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U tart -d tart_telemetry"]
interval: 30s
timeout: 5s
retries: 5
start_period: 10s
# TART Backend
tart-backend:
build: .
container_name: tart-backend
ports:
- "9000:9000" # Telemetry port
- "8080:8080" # API port
deploy:
resources:
limits:
cpus: '8'
memory: 16G
logging:
driver: json-file
options:
max-size: "100m"
max-file: "5"
environment:
# WARNING: Default credentials for LOCAL DEVELOPMENT only
# For production, set DATABASE_URL via environment variable with strong password
- DATABASE_URL=${DATABASE_URL:-postgres://tart:tart_password@postgres:5432/tart_telemetry}
- TELEMETRY_BIND=${TELEMETRY_BIND:-0.0.0.0:9000}
- API_BIND=${API_BIND:-0.0.0.0:8080}
- RUST_LOG=${RUST_LOG:-info}
# JAM RPC URL for fetching service/core data (connects to any validator's RPC)
# Ports start at 19800 and increment per validator (19800, 19801, 19802, ...)
- JAM_RPC_URL=${JAM_RPC_URL:-ws://host.docker.internal:19800}
depends_on:
postgres:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/api/health"]
interval: 60s
timeout: 10s
retries: 3
start_period: 15s
# Optional: Grafana dashboards
grafana:
image: grafana/grafana:12.3.3
container_name: tart-grafana
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Viewer
- GF_INSTALL_PLUGINS=yesoreyeram-infinity-datasource
volumes:
- grafana-data:/var/lib/grafana
- ./grafana/provisioning:/etc/grafana/provisioning
restart: unless-stopped
profiles:
- with-grafana
# Optional: JAM validator node
jam-validator-0:
image: polkajam:latest
container_name: jam-validator-0
command: >
--chain dev
run
--telemetry tart-backend:9000
--dev-validator 0
--temp
depends_on:
tart-backend:
condition: service_healthy
restart: unless-stopped
profiles:
- with-validator
volumes:
postgres-data:
driver: local
grafana-data:
driver: local