Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
133 lines (126 loc) · 4.35 KB
/
Copy pathdocker-compose.yml
File metadata and controls
133 lines (126 loc) · 4.35 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
services:
redis-node-0: &redis-node
image: redis:7.4-alpine
command: redis-server --cluster-enabled yes --cluster-config-file nodes.conf --cluster-node-timeout 5000 --appendonly yes --protected-mode no --bind 0.0.0.0
healthcheck:
test: [CMD, redis-cli, ping]
interval: 3s
timeout: 2s
retries: 20
restart: unless-stopped
redis-node-1:
<<: *redis-node
redis-node-2:
<<: *redis-node
redis-node-3:
<<: *redis-node
redis-node-4:
<<: *redis-node
redis-node-5:
<<: *redis-node
redis-cluster-init:
image: redis:7.4-alpine
command:
- sh
- -c
- >-
redis-cli --cluster create
redis-node-0:6379 redis-node-1:6379 redis-node-2:6379
redis-node-3:6379 redis-node-4:6379 redis-node-5:6379
--cluster-replicas 1 --cluster-yes || true
depends_on:
redis-node-0: { condition: service_healthy }
redis-node-1: { condition: service_healthy }
redis-node-2: { condition: service_healthy }
redis-node-3: { condition: service_healthy }
redis-node-4: { condition: service_healthy }
redis-node-5: { condition: service_healthy }
restart: 'no'
postgres:
image: timescale/timescaledb:latest-pg16
command:
[
'postgres',
'-c',
'max_worker_processes=15',
'-c',
'max_parallel_workers=8',
'-c',
'timescaledb.max_background_workers=10',
]
environment:
POSTGRES_USER: ${TIMESCALEDB_USER:-postgres}
POSTGRES_PASSWORD: ${TIMESCALEDB_PASSWORD:-postgres}
POSTGRES_DB: ${TIMESCALEDB_DATABASE:-pactum_timeseries}
ports:
- '${TIMESCALEDB_PORT:-5432}:5432'
volumes:
- pactum-postgres-data:/var/lib/postgresql/data
healthcheck:
test:
- CMD-SHELL
- pg_isready -U ${TIMESCALEDB_USER:-postgres} -d ${TIMESCALEDB_DATABASE:-pactum_timeseries}
interval: 5s
timeout: 5s
retries: 12
restart: unless-stopped
backend:
build:
context: ./backend
environment:
NODE_ENV: production
PORT: 3000
TIMESCALEDB_HOST: postgres
TIMESCALEDB_PORT: 5432
TIMESCALEDB_DATABASE: ${TIMESCALEDB_DATABASE:-pactum_timeseries}
TIMESCALEDB_USER: ${TIMESCALEDB_USER:-postgres}
TIMESCALEDB_PASSWORD: ${TIMESCALEDB_PASSWORD:-postgres}
SOROBAN_RPC_URL: ${SOROBAN_RPC_URL:-https://soroban-testnet.stellar.org:443}
SOROBAN_NETWORK_PASSPHRASE: ${SOROBAN_NETWORK_PASSPHRASE:-Test SDF Network ; September 2015}
SOROBAN_CONTRACT_ID: ${SOROBAN_CONTRACT_ID:-CBADTVTJ6IN332HIKZ7LWUYMYTLPZYCEBV3X2HS47VHR5UDBHQ3GAA7E}
REDIS_CLUSTER_NODES: redis-node-0:6379,redis-node-1:6379,redis-node-2:6379,redis-node-3:6379,redis-node-4:6379,redis-node-5:6379
REPUTATION_CACHE_TTL_SECONDS: ${REPUTATION_CACHE_TTL_SECONDS:-300}
ports:
- '${BACKEND_PORT:-3000}:3000'
depends_on:
postgres:
condition: service_healthy
redis-cluster-init:
condition: service_completed_successfully
restart: unless-stopped
indexer:
build:
context: ./backend
command: [node, dist/workers/indexer.js]
environment:
NODE_ENV: production
TIMESCALEDB_HOST: postgres
TIMESCALEDB_PORT: 5432
TIMESCALEDB_DATABASE: ${TIMESCALEDB_DATABASE:-pactum_timeseries}
TIMESCALEDB_USER: ${TIMESCALEDB_USER:-postgres}
TIMESCALEDB_PASSWORD: ${TIMESCALEDB_PASSWORD:-postgres}
SOROBAN_RPC_URL: ${SOROBAN_RPC_URL:-https://soroban-testnet.stellar.org:443}
SOROBAN_NETWORK_PASSPHRASE: ${SOROBAN_NETWORK_PASSPHRASE:-Test SDF Network ; September 2015}
SOROBAN_CONTRACT_ID: ${SOROBAN_CONTRACT_ID:-CBADTVTJ6IN332HIKZ7LWUYMYTLPZYCEBV3X2HS47VHR5UDBHQ3GAA7E}
REDIS_CLUSTER_NODES: redis-node-0:6379,redis-node-1:6379,redis-node-2:6379,redis-node-3:6379,redis-node-4:6379,redis-node-5:6379
INDEXER_FINALITY_DEPTH: ${INDEXER_FINALITY_DEPTH:-2}
INDEXER_POLL_INTERVAL_MS: ${INDEXER_POLL_INTERVAL_MS:-1000}
depends_on:
postgres:
condition: service_healthy
redis-cluster-init:
condition: service_completed_successfully
restart: unless-stopped
frontend:
build:
context: ./frontend
args:
VITE_API_URL: ${VITE_API_URL-}
ports:
- '${FRONTEND_PORT:-80}:80'
depends_on:
backend:
condition: service_healthy
restart: unless-stopped
volumes:
pactum-postgres-data: