Skip to content

Instantly share code, notes, and snippets.

@wladpaiva
Last active July 19, 2024 11:27
Show Gist options
  • Save wladpaiva/ef9a2aa83e0c47d16a0f7cd91b453312 to your computer and use it in GitHub Desktop.
Save wladpaiva/ef9a2aa83e0c47d16a0f7cd91b453312 to your computer and use it in GitHub Desktop.
docker-compose with mempool and electrum server
version: '3.8'
services:
postgres:
image: postgres:latest
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
ports:
- '5432:5432'
volumes:
- ./docker-data/postgres:/var/lib/postgresql/data
mempool-electrs:
image: mempool/electrs:latest
restart: always
entrypoint: /bin/electrs
command: |
--address-search
--db-dir /data
--cors '*'
--network regtest
--electrum-rpc-addr '0.0.0.0:50001'
--http-addr '0.0.0.0:3000'
--cookie polaruser:polarpass
--daemon-rpc-addr 'host.docker.internal:18443'
--lightmode
--timestamp
-v
volumes:
# I could not figure out a better way to get the bitcoind data directory
# from polar into the electrs container. This is a workaround. :)
- ~/.polar/networks/1/volumes/bitcoind/backend1:/root/.bitcoin:ro
- ./docker-data/electrs:/data
ports:
- '50001:50001'
- '50002:3000'
mempool-api:
image: mempool/backend:latest
restart: on-failure
user: '1000:1000'
stop_grace_period: 1m
depends_on:
- mempool-db
- mempool-electrs
command:
'./wait-for-it.sh mempool-db:3306 --timeout=720 --strict -- ./start.sh'
environment:
MEMPOOL_BACKEND: 'electrum'
ELECTRUM_HOST: 'host.docker.internal'
ELECTRUM_PORT: '50001'
ELECTRUM_TLS_ENABLED: 'false'
CORE_RPC_HOST: 'host.docker.internal'
CORE_RPC_PORT: '18443'
CORE_RPC_USERNAME: 'polaruser'
CORE_RPC_PASSWORD: 'polarpass'
DATABASE_ENABLED: 'true'
DATABASE_HOST: 'mempool-db'
DATABASE_DATABASE: 'mempool'
DATABASE_USERNAME: 'mempool'
DATABASE_PASSWORD: 'mempool'
STATISTICS_ENABLED: 'true'
ports:
- '8999:8999'
volumes:
- ./docker-data/mempool:/backend/cache
mempool-db:
image: mariadb:10.5.21
user: '1000:1000'
restart: on-failure
stop_grace_period: 1m
environment:
MYSQL_DATABASE: 'mempool'
MYSQL_USER: 'mempool'
MYSQL_PASSWORD: 'mempool'
MYSQL_ROOT_PASSWORD: 'admin'
volumes:
- ./docker-data/mysql:/var/lib/mysql
# bitcoin-core:
# image: polarlightning/bitcoind:26.0
# hostname: bitcoin-core
# stop_grace_period: 5m
# restart: always
# environment:
# USERID: ${USERID:-1000}
# GROUPID: ${GROUPID:-1000}
# command:
# [
# '-server=1',
# '-regtest=1',
# '-rpcauth=polaruser:5e5e98c21f5c814568f8b55d83b23c1c$066b03f92df30b11de8e4b1b1cd5b1b4281aa25205bd57df9be82caf97a05526',
# '-debug=1',
# '-zmqpubrawblock=tcp://0.0.0.0:28334',
# '-zmqpubrawtx=tcp://0.0.0.0:28335',
# '-zmqpubhashblock=tcp://0.0.0.0:28336',
# '-txindex=1',
# '-dnsseed=0',
# '-upnp=0',
# '-rpcbind=0.0.0.0',
# '-rpcallowip=0.0.0.0/0',
# '-rpcport=18443',
# '-rest',
# '-listen=1',
# '-listenonion=0',
# '-fallbackfee=0.0002',
# '-blockfilterindex=1',
# '-peerblockfilters=1',
# ]
# expose:
# - '18443'
# - '18444'
# - '28334'
# - '28335'
# ports:
# - '18443:18443'
# - '19444:18444'
# - '28334:28334'
# - '29335:28335'
# volumes:
# - ./docker-data/bitcoin-core:/home/bitcoin/.bitcoin
# # Merchant's Lightning Node that will only have a channel with musqet-node
# merchant-node:
# image: polarlightning/lnd:0.17.4-beta
# hostname: merchant-node
# stop_grace_period: 2m
# environment:
# USERID: ${USERID:-1000}
# GROUPID: ${GROUPID:-1000}
# command:
# [
# 'lnd',
# '--noseedbackup',
# '--trickledelay=5000',
# '--alias=merchant-node',
# '--externalip=merchant-node',
# '--tlsextradomain=merchant-node',
# '--tlsextradomain=merchant-node',
# '--tlsextradomain=host.docker.internal',
# '--listen=0.0.0.0:9735',
# '--rpclisten=0.0.0.0:10009',
# '--restlisten=0.0.0.0:8080',
# '--bitcoin.active',
# '--bitcoin.regtest',
# '--bitcoin.node=bitcoind',
# '--bitcoind.rpchost=bitcoin-core',
# '--bitcoind.rpcuser=polaruser',
# '--bitcoind.rpcpass=polarpass',
# '--bitcoind.zmqpubrawblock=tcp://bitcoin-core:28334',
# '--bitcoind.zmqpubrawtx=tcp://bitcoin-core:28335',
# ]
# restart: always
# volumes:
# - ./docker-data/merchant-node:/home/lnd/.lnd
# expose:
# - '8080'
# - '10009'
# - '9735'
# ports:
# - '8081:8080'
# - '10001:10009'
# - '9735:9735'
# # Musqet's Lightning Node
# musqet-node:
# image: polarlightning/lnd:0.17.4-beta
# hostname: musqet-node
# stop_grace_period: 2m
# environment:
# USERID: ${USERID:-1000}
# GROUPID: ${GROUPID:-1000}
# command:
# [
# 'lnd',
# '--noseedbackup',
# '--trickledelay=5000',
# '--alias=musqet-node',
# '--externalip=musqet-node',
# '--tlsextradomain=musqet-node',
# '--tlsextradomain=musqet-node',
# '--tlsextradomain=host.docker.internal',
# '--listen=0.0.0.0:9735',
# '--rpclisten=0.0.0.0:10009',
# '--restlisten=0.0.0.0:8080',
# '--bitcoin.active',
# '--bitcoin.regtest',
# '--bitcoin.node=bitcoind',
# '--bitcoind.rpchost=bitcoin-core',
# '--bitcoind.rpcuser=polaruser',
# '--bitcoind.rpcpass=polarpass',
# '--bitcoind.zmqpubrawblock=tcp://bitcoin-core:28334',
# '--bitcoind.zmqpubrawtx=tcp://bitcoin-core:28335',
# ]
# restart: always
# volumes:
# - ./docker-data/musqet-node:/home/lnd/.lnd
# expose:
# - '8080'
# - '10009'
# - '9735'
# ports:
# - '8082:8080'
# - '10002:10009'
# - '9736:9735'
# public-node:
# image: polarlightning/lnd:0.17.4-beta
# hostname: public-node
# stop_grace_period: 2m
# environment:
# USERID: ${USERID:-1000}
# GROUPID: ${GROUPID:-1000}
# command:
# [
# 'lnd',
# '--noseedbackup',
# '--trickledelay=5000',
# '--alias=public-node',
# '--externalip=public-node',
# '--tlsextradomain=public-node',
# '--tlsextradomain=public-node',
# '--tlsextradomain=host.docker.internal',
# '--listen=0.0.0.0:9735',
# '--rpclisten=0.0.0.0:10009',
# '--restlisten=0.0.0.0:8080',
# '--bitcoin.active',
# '--bitcoin.regtest',
# '--bitcoin.node=bitcoind',
# '--bitcoind.rpchost=bitcoin-core',
# '--bitcoind.rpcuser=polaruser',
# '--bitcoind.rpcpass=polarpass',
# '--bitcoind.zmqpubrawblock=tcp://bitcoin-core:28334',
# '--bitcoind.zmqpubrawtx=tcp://bitcoin-core:28335',
# ]
# restart: always
# volumes:
# - ./docker-data/public-node:/home/lnd/.lnd
# expose:
# - '8080'
# - '10009'
# - '9735'
# ports:
# - '8083:8080'
# - '10003:10009'
# - '9737:9735'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment