mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 09:05:06 -07:00
Migrate pool storage to TimescaleDB and Redis
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
bitcoin:
|
||||
container_name: bitcoin
|
||||
@@ -20,6 +18,50 @@ services:
|
||||
- "./data/mainnet/bitcoin:/app/data"
|
||||
- "./bitcoin-mainnet.conf:/app/data/bitcoin.conf:ro"
|
||||
|
||||
timescaledb:
|
||||
image: timescale/timescaledb:latest-pg17
|
||||
container_name: public-pool-mainnet-timescaledb
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- bitcoin
|
||||
environment:
|
||||
POSTGRES_DB: public_pool_mainnet
|
||||
POSTGRES_USER: public_pool
|
||||
POSTGRES_PASSWORD: public_pool
|
||||
command:
|
||||
- postgres
|
||||
- -c
|
||||
- max_wal_size=16GB
|
||||
- -c
|
||||
- min_wal_size=2GB
|
||||
- -c
|
||||
- checkpoint_timeout=15min
|
||||
- -c
|
||||
- checkpoint_completion_target=0.9
|
||||
- -c
|
||||
- wal_compression=on
|
||||
volumes:
|
||||
- "./data/mainnet/timescaledb:/var/lib/postgresql/data"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U public_pool -d public_pool_mainnet"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
|
||||
redis:
|
||||
image: redis:8-alpine
|
||||
container_name: public-pool-mainnet-redis
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- bitcoin
|
||||
volumes:
|
||||
- "./data/mainnet/redis:/data"
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
|
||||
public-pool:
|
||||
container_name: public-pool
|
||||
build:
|
||||
@@ -27,16 +69,36 @@ services:
|
||||
dockerfile: Dockerfile
|
||||
restart: unless-stopped
|
||||
stop_grace_period: 30s
|
||||
depends_on:
|
||||
timescaledb:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- bitcoin
|
||||
ports:
|
||||
- "0.0.0.0:3333:3333/tcp"
|
||||
- "0.0.0.0:3332:3332/tcp"
|
||||
- "0.0.0.0:3331:3331/tcp"
|
||||
- "0.0.0.0:3330:3330/tcp"
|
||||
- "0.0.0.0:4333:4333/tcp"
|
||||
- "0.0.0.0:4332:4332/tcp"
|
||||
- "0.0.0.0:4331:4331/tcp"
|
||||
- "0.0.0.0:4330:4330/tcp"
|
||||
- "127.0.0.1:3334:3334/tcp"
|
||||
volumes:
|
||||
- "./data/mainnet/public-pool:/public-pool/DB"
|
||||
- "./public-pool-mainnet.env:/public-pool/.env:ro"
|
||||
- "../secrets:/public-pool/secrets:ro"
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
NODE_ENV: production
|
||||
DB_HOST: timescaledb
|
||||
DB_PORT: 5432
|
||||
DB_USERNAME: public_pool
|
||||
DB_PASSWORD: public_pool
|
||||
DB_DATABASE: public_pool_mainnet
|
||||
REDIS_URL: redis://redis:6379
|
||||
PM2_ENABLED: "true"
|
||||
STRATUM_WORKERS: ${STRATUM_WORKERS:-2}
|
||||
|
||||
networks:
|
||||
bitcoin:
|
||||
|
||||
Reference in New Issue
Block a user