docker-compose.yaml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. version: '3.8'
  2. services:
  3. # CDK Mint service
  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:
  36. build:
  37. context: .
  38. dockerfile: Dockerfile
  39. container_name: mint
  40. ports:
  41. - "8085:8085"
  42. environment:
  43. - CDK_MINTD_URL=https://example.com
  44. - CDK_MINTD_LN_BACKEND=fakewallet
  45. - CDK_MINTD_LISTEN_HOST=0.0.0.0
  46. - CDK_MINTD_LISTEN_PORT=8085
  47. - CDK_MINTD_MNEMONIC=
  48. # Database configuration - choose one:
  49. # Option 1: SQLite (embedded, no additional setup needed)
  50. - CDK_MINTD_DATABASE=sqlite
  51. # Option 2: ReDB (embedded, no additional setup needed)
  52. # - CDK_MINTD_DATABASE=redb
  53. # Option 3: PostgreSQL (requires postgres service, enable with: docker-compose --profile postgres up)
  54. # - CDK_MINTD_DATABASE=postgres
  55. # - CDK_MINTD_DATABASE_URL=postgresql://cdk_user:cdk_password@postgres:5432/cdk_mint
  56. # Cache configuration
  57. - CDK_MINTD_CACHE_BACKEND=memory
  58. - CDK_MINTD_PROMETHEUS_ENABLED=true
  59. - CDK_MINTD_PROMETHEUS_ADDRESS=0.0.0.0
  60. - CDK_MINTD_PROMETHEUS_PORT=9000
  61. command: ["cdk-mintd"]
  62. depends_on:
  63. - prometheus
  64. - grafana
  65. networks:
  66. - cdk
  67. # Uncomment when using PostgreSQL:
  68. # depends_on:
  69. # - postgres
  70. # LDK Node mint service - enable with: docker-compose --profile ldk-node up
  71. mintd-ldk-node:
  72. build:
  73. context: .
  74. dockerfile: Dockerfile.ldk-node
  75. container_name: mint-ldk-node
  76. profiles:
  77. - ldk-node
  78. ports:
  79. - "8086:8085" # Different port to avoid conflict with main mint
  80. environment:
  81. - CDK_MINTD_URL=https://example.com
  82. - CDK_MINTD_LN_BACKEND=ldk-node
  83. - CDK_MINTD_LISTEN_HOST=0.0.0.0
  84. - CDK_MINTD_LISTEN_PORT=8085
  85. - CDK_MINTD_MNEMONIC=
  86. # Database configuration
  87. - CDK_MINTD_DATABASE=sqlite
  88. # Cache configuration
  89. - CDK_MINTD_CACHE_BACKEND=memory
  90. - CDK_MINTD_PROMETHEUS_ENABLED=true
  91. - CDK_MINTD_PROMETHEUS_ADDRESS=0.0.0.0
  92. - CDK_MINTD_PROMETHEUS_PORT=9000
  93. # LDK Node specific configuration
  94. - CDK_MINTD_LDK_NODE_NETWORK=testnet
  95. - CDK_MINTD_LDK_NODE_ESPLORA_URL=https://blockstream.info/testnet/api
  96. - CDK_MINTD_LDK_NODE_LISTENING_ADDRESSES=0.0.0.0:9735
  97. volumes:
  98. # Persist LDK node data
  99. - ldk_node_data:/usr/src/app/ldk_node_data
  100. command: ["cdk-mintd"]
  101. depends_on:
  102. - prometheus
  103. - grafana
  104. networks:
  105. - cdk
  106. # PostgreSQL database service
  107. # Enable with: docker-compose --profile postgres up
  108. # postgres:
  109. # image: postgres:16-alpine
  110. # container_name: mint_postgres
  111. # restart: unless-stopped
  112. # profiles:
  113. # - postgres
  114. # environment:
  115. # - POSTGRES_USER=cdk_user
  116. # - POSTGRES_PASSWORD=cdk_password
  117. # - POSTGRES_DB=cdk_mint
  118. # - POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=C --lc-ctype=C
  119. # ports:
  120. # - "5432:5432"
  121. # volumes:
  122. # - postgres_data:/var/lib/postgresql/data
  123. # healthcheck:
  124. # test: ["CMD-SHELL", "pg_isready -U cdk_user -d cdk_mint"]
  125. # interval: 10s
  126. # timeout: 5s
  127. # retries: 5
  128. volumes:
  129. postgres_data:
  130. driver: local
  131. ldk_node_data:
  132. driver: local
  133. networks:
  134. cdk:
  135. driver: bridge