docker-compose.ldk-node.yaml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. version: '3.8'
  2. services:
  3. # CDK Mint service with LDK Node backend
  4. prometheus:
  5. image: prom/prometheus:latest
  6. ports:
  7. - "9090:9090"
  8. volumes:
  9. - ./misc/provisioning/prometheus.yml:/etc/prometheus/prometheus.yml:ro
  10. command:
  11. - '--config.file=/etc/prometheus/prometheus.yml'
  12. - '--storage.tsdb.path=/prometheus'
  13. - '--web.console.libraries=/etc/prometheus/console_libraries'
  14. - '--web.console.templates=/etc/prometheus/consoles'
  15. - '--web.enable-lifecycle'
  16. - '--enable-feature=otlp-write-receiver'
  17. extra_hosts:
  18. - "host.docker.internal:host-gateway"
  19. networks:
  20. - cdk
  21. # Grafana for visualization
  22. grafana:
  23. image: grafana/grafana:latest
  24. ports:
  25. - "3011:3000"
  26. volumes:
  27. - ./misc/provisioning/datasources:/etc/grafana/provisioning/datasources
  28. - ./misc/provisioning/dashboards:/etc/grafana/provisioning/dashboards
  29. environment:
  30. - GF_DASHBOARDS_JSON_ENABLED=true
  31. - GF_SECURITY_ADMIN_PASSWORD=admin
  32. - GF_PROVISIONING_PATHS=/etc/grafana/provisioning
  33. networks:
  34. - cdk
  35. mintd-ldk-node:
  36. # Use the ldk-node tagged image from the same repository
  37. image: cashubtc/mintd:ldk-node-amd64
  38. # Alternatively, build locally:
  39. # build:
  40. # context: .
  41. # dockerfile: Dockerfile.ldk-node
  42. container_name: mint-ldk-node
  43. ports:
  44. - "8085:8085"
  45. - "8091:8091" # LDK admin dashboard (WARNING!!! Do not expose to network! Doing so will leave LDK node funds accessible by whole network)
  46. environment:
  47. - CDK_MINTD_URL=https://example.com
  48. - CDK_MINTD_LN_BACKEND=ldk-node
  49. - CDK_MINTD_LISTEN_HOST=0.0.0.0
  50. - CDK_MINTD_LISTEN_PORT=8085
  51. - CDK_MINTD_MNEMONIC=
  52. # Database configuration - choose one:
  53. # Option 1: SQLite (embedded, no additional setup needed)
  54. - CDK_MINTD_DATABASE=sqlite
  55. # Option 2: ReDB (embedded, no additional setup needed)
  56. # - CDK_MINTD_DATABASE=redb
  57. # Option 3: PostgreSQL (requires postgres service, enable with: docker-compose --profile postgres up)
  58. # - CDK_MINTD_DATABASE=postgres
  59. # - CDK_MINTD_DATABASE_URL=postgresql://cdk_user:cdk_password@postgres:5432/cdk_mint
  60. # Cache configuration
  61. - CDK_MINTD_CACHE_BACKEND=memory
  62. - CDK_MINTD_PROMETHEUS_ENABLED=true
  63. - CDK_MINTD_PROMETHEUS_ADDRESS=0.0.0.0
  64. - CDK_MINTD_PROMETHEUS_PORT=9000
  65. # LDK Node specific configuration
  66. - CDK_MINTD_LDK_NODE_BITCOIN_NETWORK=testnet # or: testnet, signet, regtest
  67. - CDK_MINTD_LDK_NODE_ESPLORA_URL=https://blockstream.info/testnet/api
  68. - CDK_MINTD_LDK_NODE_LISTENING_ADDRESSES=0.0.0.0:9735
  69. # LDK admin dashboard config
  70. - CDK_MINTD_LDK_NODE_WEBSERVER_HOST=0.0.0.0
  71. # Other Options
  72. # - CDK_MINTD_LDK_NODE_WEBSERVER_PORT=
  73. # - CDK_MINTD_LDK_NODE_FEE_PERCENT=
  74. # - CDK_MINTD_LDK_NODE_RESERVE_FEE_MIN=
  75. # - CDK_MINTD_LDK_NODE_CHAIN_SOURCE_TYPE=esplora # or: bitcoinrpc
  76. # if chain source is set to bitcoinrpc, the following RPC options need to be set instead
  77. # - CDK_MINTD_LDK_NODE_BITCOIND_RPC_HOST=
  78. # - CDK_MINTD_LDK_NODE_BITCOIND_RPC_PORT=
  79. # - CDK_MINTD_LDK_NODE_BITCOIND_RPC_USER=
  80. # - CDK_MINTD_LDK_NODE_BITCOIND_RPC_PASSWORD=
  81. # - CDK_MINTD_LDK_NODE_STORAGE_DIR_PATH=
  82. # - CDK_MINTD_LDK_NODE_LDK_NODE_HOST=
  83. # - CDK_MINTD_LDK_NODE_LDK_NODE_PORT=
  84. # - CDK_MINTD_LDK_NODE_GOSSIP_SOURCE_TYPE=rgs # or: p2p
  85. # - CDK_MINTD_LDK_NODE_RGS_URL=
  86. volumes:
  87. # Persist LDK node data
  88. - ldk_node_data:/usr/src/app/ldk_node_data
  89. command: ["cdk-mintd"]
  90. depends_on:
  91. - prometheus
  92. - grafana
  93. networks:
  94. - cdk
  95. # Uncomment when using PostgreSQL:
  96. # depends_on:
  97. # - postgres
  98. # PostgreSQL database service
  99. # Enable with: docker-compose --profile postgres up
  100. postgres:
  101. image: postgres:16-alpine
  102. container_name: mint_postgres
  103. restart: unless-stopped
  104. profiles:
  105. - postgres
  106. environment:
  107. - POSTGRES_USER=cdk_user
  108. - POSTGRES_PASSWORD=cdk_password
  109. - POSTGRES_DB=cdk_mint
  110. - POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=C --lc-ctype=C
  111. ports:
  112. - "5432:5432"
  113. volumes:
  114. - postgres_data:/var/lib/postgresql/data
  115. healthcheck:
  116. test: ["CMD-SHELL", "pg_isready -U cdk_user -d cdk_mint"]
  117. interval: 10s
  118. timeout: 5s
  119. retries: 5
  120. networks:
  121. - cdk
  122. volumes:
  123. postgres_data:
  124. driver: local
  125. ldk_node_data:
  126. driver: local
  127. networks:
  128. cdk:
  129. driver: bridge