-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
executable file
·186 lines (183 loc) · 6.01 KB
/
docker-compose.yaml
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
services:
snapshotter-local-collector:
image: ${SNAPSHOTTER_COLLECTOR_IMAGE:-ghcr.io/powerloom/snapshotter-lite-local-collector:dockerify}
profiles: ["local-collector"]
depends_on:
redis:
condition: service_healthy
expose:
- ${LOCAL_COLLECTOR_PORT:-50051}
ports:
- ${LOCAL_COLLECTOR_PORT:-50051}:${LOCAL_COLLECTOR_PORT:-50051}
volumes:
- ./logs/local-collector:/root/.pm2/logs
environment:
- SIGNER_ACCOUNT_ADDRESS=$SIGNER_ACCOUNT_ADDRESS
- SIGNER_ACCOUNT_PRIVATE_KEY=$SIGNER_ACCOUNT_PRIVATE_KEY
- IPFS_URL=$IPFS_URL
- IPFS_API_KEY=$IPFS_API_KEY
- IPFS_API_SECRET=$IPFS_API_SECRET
- PROTOCOL_STATE_CONTRACT=$PROTOCOL_STATE_CONTRACT
- DATA_MARKET_CONTRACT=$DATA_MARKET_CONTRACT
- PROST_RPC_URL=$PROST_RPC_URL
- PROST_CHAIN_ID=$PROST_CHAIN_ID
- REDIS_HOST=${REDIS_HOST:-redis}
- REDIS_PORT=${REDIS_PORT:-6379}
- LOCAL_COLLECTOR_PORT=$LOCAL_COLLECTOR_PORT
- RELAYER_PRIVATE_KEY=$RELAYER_PRIVATE_KEY
- BLOCK_TIME=$BLOCK_TIME
- MAX_STREAM_POOL_SIZE=$MAX_STREAM_POOL_SIZE
- STREAM_HEALTH_CHECK_TIMEOUT_MS=$STREAM_HEALTH_CHECK_TIMEOUT_MS
- STREAM_WRITE_TIMEOUT_MS=$STREAM_WRITE_TIMEOUT_MS
- MAX_WRITE_RETRIES=$MAX_WRITE_RETRIES
- MAX_CONCURRENT_WRITES=$MAX_CONCURRENT_WRITES
- STREAM_POOL_HEALTH_CHECK_INTERVAL=$STREAM_POOL_HEALTH_CHECK_INTERVAL
- DATA_MARKET_IN_REQUEST=$DATA_MARKET_IN_REQUEST
networks:
- custom_network
restart: on-failure:10
ulimits:
nofile:
soft: 65536
hard: 65536
snapshotter-core:
image: ${SNAPSHOTTER_IMAGE:-ghcr.io/powerloom/snapshotter-core:dockerify}
expose:
- ${CORE_API_PORT:-8002}
ports:
- ${CORE_API_PORT-8002}:${CORE_API_PORT-8002}
depends_on:
redis:
condition: service_healthy
rabbitmq:
condition: service_healthy
snapshotter-local-collector:
condition: service_started
volumes:
- ./logs/snapshotter:/logs
- ./config:/config
- ./computes:/computes
- ./snapshotter:/snapshotter
- ./poetry.lock:/poetry.lock
- ./pyproject.toml:/pyproject.toml
environment:
- SIGNER_ACCOUNT_ADDRESS=$SIGNER_ACCOUNT_ADDRESS
- SIGNER_ACCOUNT_PRIVATE_KEY=$SIGNER_ACCOUNT_PRIVATE_KEY
- SLOT_ID=$SLOT_ID
- SOURCE_RPC_URL=$SOURCE_RPC_URL
- PROST_RPC_URL=$PROST_RPC_URL
- IPFS_URL=$IPFS_URL
- IPFS_API_KEY=$IPFS_API_KEY
- IPFS_API_SECRET=$IPFS_API_SECRET
- PROTOCOL_STATE_CONTRACT=$PROTOCOL_STATE_CONTRACT
- DATA_MARKET_CONTRACT=$DATA_MARKET_CONTRACT
- LOCAL_COLLECTOR_PORT=$LOCAL_COLLECTOR_PORT
- SLACK_REPORTING_URL=$SLACK_REPORTING_URL
- POWERLOOM_REPORTING_URL=$POWERLOOM_REPORTING_URL
- NAMESPACE=$NAMESPACE
- TELEGRAM_REPORTING_URL=$TELEGRAM_REPORTING_URL
- TELEGRAM_CHAT_ID=$TELEGRAM_CHAT_ID
- REDIS_HOST=${REDIS_HOST:-redis}
- REDIS_PORT=${REDIS_PORT:-6379}
- REDIS_PASSWORD=${REDIS_PASSWORD:-}
- IPFS_S3_CONFIG_ENABLED=$IPFS_S3_CONFIG_ENABLED
- IPFS_S3_CONFIG_ENDPOINT_URL=$IPFS_S3_CONFIG_ENDPOINT_URL
- IPFS_S3_CONFIG_BUCKET_NAME=$IPFS_S3_CONFIG_BUCKET_NAME
- IPFS_S3_CONFIG_ACCESS_KEY=$IPFS_S3_CONFIG_ACCESS_KEY
- IPFS_S3_CONFIG_SECRET_KEY=$IPFS_S3_CONFIG_SECRET_KEY
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8002/health"]
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
command:
bash -c "bash snapshotter_autofill.sh && bash init_processes.sh"
extra_hosts:
- "host.docker.internal:host-gateway"
networks:
- custom_network
ipfs:
image: ipfs/kubo:master-latest
profiles: ["ipfs"]
environment:
- IPFS_PROFILE=server
- DATA_CLEANUP_DAYS=3
- CLEANUP_SCHEDULE=0 */3 * * *
- LIBP2P_FORCE_PNET=0
- IPFS_ROUTING=dhtclient
entrypoint: >
/bin/sh -c '
echo "Setting up data cleanup cron job...";
mkdir -p /var/spool/cron/crontabs;
cleanup_cmd="date && echo \"Starting hourly cleanup process...\" && find /data/ipfs -type f -mtime +$${DATA_CLEANUP_DAYS} -name \"*.data\" -print -delete && echo \"Hourly cleanup process completed.\"";
echo "$${CLEANUP_SCHEDULE} $${cleanup_cmd} >> /proc/1/fd/1 2>&1" > /var/spool/cron/crontabs/root;
chmod 0644 /var/spool/cron/crontabs/root;
echo "Cron job set up. Will clean files older than $${DATA_CLEANUP_DAYS} days every hour ($${CLEANUP_SCHEDULE})";
echo "Starting cron daemon...";
crond;
echo "Starting IPFS daemon...";
exec /sbin/tini -- /usr/local/bin/start_ipfs daemon --migrate=true --agent-version-suffix=docker
'
volumes:
- ./ipfs-data:/data/ipfs
- ./ipfs-export:/export
ports:
- "4001:4001" # Swarm listening port
- "5001:5001" # API server
- "8080:8080" # Gateway
healthcheck:
test: ["CMD", "ipfs", "id"]
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
networks:
- custom_network
ulimits:
nofile:
soft: 65536
hard: 65536
redis:
command: redis-server --appendonly yes
image: "redis:alpine"
expose:
- 6379
ports:
- 6379:6379
healthcheck:
test: ["CMD", "sh", "-c", "redis-cli ping | grep -q PONG && ! redis-cli info persistence | grep -q 'loading:1'"]
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
restart: on-failure
networks:
- custom_network
volumes:
- ./redis_data:/data
rabbitmq:
image: rabbitmq:3-management
#command: ["daemon"]
expose:
- 15672
- 5672
ports:
- 5672:5672
- 15672:15672
healthcheck:
test: rabbitmq-diagnostics check_port_connectivity
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
restart: on-failure
networks:
- custom_network
networks:
custom_network:
name: ${DOCKER_NETWORK_NAME}
driver: bridge
ipam:
config:
- subnet: ${DOCKER_NETWORK_SUBNET}