version: "3" services: <% if ( features.indexOf('tor') !== -1 ) { %> ########################## # TOR # ########################## tor: image: cyphernode/tor:<%= tor_version %> # Sleeping 7 seconds to let lightning and traefik start command: $USER sh -c 'rm -f /container_monitor/tor_ready ; sleep 10 ; export HOME=/tor ; tor -f /tor/torrc' volumes: - "<%= tor_datapath %>:/tor" - container_monitor:/container_monitor healthcheck: test: chown $USER /container_monitor && su-exec $USER sh -c 'tor-resolve torproject.org && touch /container_monitor/tor_ready && chown $USER /container_monitor/tor_ready || rm -f /container_monitor/tor_ready' interval: 20s timeout: 10s retries: 10 networks: - cyphernodenet - cyphernodeappsnet <% if (docker_mode == 'compose') { %> restart: always <% } %> # deploy: # placement: # constraints: [node.hostname==dev] <% } %> <% if ( features.indexOf('lightning') !== -1 && lightning_implementation === 'c-lightning' ) { %> ########################## # LIGHTNING # ########################## lightning: image: cyphernode/clightning:<%= lightning_version %> command: $USER /.lightning/bitcoin/entrypoint.sh <% if( lightning_expose ) { %> ports: - "9735:9735" <% } %> volumes: - "<%= lightning_datapath %>:/.lightning" - "<%= bitcoin_datapath %>/bitcoin-client.conf:/.bitcoin/bitcoin.conf:ro" - container_monitor:/container_monitor healthcheck: test: chown $USER /container_monitor && su-exec $USER sh -c 'lightning-cli getinfo && touch /container_monitor/lightning_ready && chown $USER /container_monitor/lightning_ready || rm -f /container_monitor/lightning_ready' interval: 20s timeout: 10s retries: 10 stop_grace_period: 30s networks: - cyphernodenet <% if (docker_mode == 'compose') { %> restart: always <% } %> <% if ( features.indexOf('tor') !== -1 ) { %> depends_on: - tor <% } %> # deploy: --lightning-dir=/.lightning # placement: # constraints: [node.hostname==dev] <% } %> <% if( bitcoin_mode === 'internal' ) { %> ########################## # BITCOIN # ########################## bitcoin: image: cyphernode/bitcoin:<%= bitcoin_version %> <% if ( features.indexOf('tor') !== -1 && torifyables && torifyables.indexOf('tor_bitcoin') !== -1 ) { %> command: $USER sh -c 'rm -f /container_monitor/bitcoin_ready ; while [ ! -f "/container_monitor/tor_ready" ]; do echo "tor not ready" ; sleep 10 ; done ; echo "tor ready" ; bitcoind' <% } else { %> command: $USER sh -c 'rm -f /container_monitor/bitcoin_ready ; bitcoind' <% } %> <% if( bitcoin_expose ) { %> ports: - "<%= (net === 'regtest') ? '18444:18444' : ((net === 'testnet') ? '18333:18333' : '8333:8333') %>" <% } %> volumes: - "<%= bitcoin_datapath %>:/.bitcoin" - container_monitor:/container_monitor healthcheck: test: chown $USER /container_monitor && su-exec $USER sh -c 'bitcoin-cli echo && touch /container_monitor/bitcoin_ready || rm -f /container_monitor/bitcoin_ready' interval: 20s timeout: 10s retries: 10 stop_grace_period: 30s networks: - cyphernodenet <% if (docker_mode == 'compose') { %> restart: always <% } %> <% if ( features.indexOf('tor') !== -1 ) { %> depends_on: - tor <% } %> # deploy: # placement: # constraints: [node.hostname==dev] <% } %> ########################## # PROXY # ########################## proxy: image: cyphernode/proxy:<%= proxy_version %> command: $USER ./startproxy.sh environment: - "TRACING=1" - "WATCHER_BTC_NODE_RPC_URL=<%= (bitcoin_mode === 'internal') ? 'bitcoin' : bitcoin_node_ip %>:<%= (net === 'regtest') ? '18443' : ((net === 'testnet') ? '18332' : '8332') %>/wallet" - "WATCHER_BTC_NODE_DEFAULT_WALLET=watching01.dat" - "WATCHER_BTC_NODE_XPUB_WALLET=xpubwatching01.dat" - "WATCHER_BTC_NODE_RPC_USER=<%= bitcoin_rpcuser %>:<%= bitcoin_rpcpassword %>" - "WATCHER_BTC_NODE_RPC_CFG=/tmp/watcher_btcnode_curlcfg.properties" - "SPENDER_BTC_NODE_RPC_URL=<%= (bitcoin_mode === 'internal') ? 'bitcoin' : bitcoin_node_ip %>:<%= (net === 'regtest') ? '18443' : ((net === 'testnet') ? '18332' : '8332') %>/wallet" - "SPENDER_BTC_NODE_DEFAULT_WALLET=spending01.dat" - "SPENDER_BTC_NODE_RPC_USER=<%= bitcoin_rpcuser %>:<%= bitcoin_rpcpassword %>" - "SPENDER_BTC_NODE_RPC_CFG=/tmp/spender_btcnode_curlcfg.properties" - "PROXY_LISTENING_PORT=8888" - "DB_PATH=/proxy/db" - "DB_FILE=/proxy/db/proxydb" - "PYCOIN_CONTAINER=pycoin:7777" <% if ( use_xpub && xpub ) { %> - "DERIVATION_PUB32=<%= xpub %>" - "DERIVATION_PATH=<%= derivation_path %>" <% } %> - "WATCHER_BTC_NODE_PRUNED=<%= bitcoin_prune ? 'true' : 'false' %>" - "OTSCLIENT_CONTAINER=otsclient:6666" - "OTS_FILES=/proxy/otsfiles" - "XPUB_DERIVATION_GAP=100" <% if ( devmode ) { %> ports: - "8888:8888" <% } %> volumes: - "<%= logs_datapath %>:/cnlogs" - "<%= proxy_datapath %>:/proxy/db" <% if ( features.indexOf('lightning') !== -1 && lightning_implementation === 'c-lightning' ) { %> - "<%= lightning_datapath %>:/.lightning" <% } %> <% if ( features.indexOf('otsclient') !== -1 ) { %> - "<%= otsclient_datapath %>:/proxy/otsfiles" <% } %> <% if ( features.indexOf('tor') !== -1 ) { %> - "<%= tor_datapath %>:/proxy/tor" <% } %> networks: - cyphernodenet <% if (docker_mode == 'compose') { %> restart: always <% } %> # deploy: # placement: # constraints: [node.hostname==dev] ########################## # PROXYCRON # ########################## proxycron: image: cyphernode/proxycron:<%= proxycron_version %> environment: - "TX_CONF_URL=proxy:8888/executecallbacks" - "OTS_URL=proxy:8888/ots_backoffice" networks: - cyphernodenet <% if (docker_mode == 'compose') { %> restart: always <% } %> depends_on: - proxy # deploy: # placement: # constraints: [node.hostname==dev] ########################## # BROKER # ########################## broker: image: eclipse-mosquitto:<%= mosquitto_version %> networks: - cyphernodenet - cyphernodeappsnet <% if (docker_mode == 'compose') { %> restart: always <% } %> # deploy: # placement: # constraints: [node.hostname==dev] ########################## # NOTIFIER # ########################## notifier: image: cyphernode/notifier:<%= notifier_version %> command: $USER ./startnotifier.sh <% if ( features.indexOf('tor') !== -1 ) { %> environment: - "TOR_HOST=tor" - "TOR_PORT=9050" <% } %> volumes: - "<%= logs_datapath %>:/cnlogs" networks: - cyphernodenet - cyphernodeappsnet <% if (docker_mode == 'compose') { %> restart: always <% } %> depends_on: - broker # deploy: # placement: # constraints: [node.hostname==dev] ########################## # PYCOIN # ########################## pycoin: image: cyphernode/pycoin:<%= pycoin_version %> command: $USER ./startpycoin.sh environment: - "TRACING=1" - "PYCOIN_LISTENING_PORT=7777" <% if ( devmode ) { %> ports: - "7777:7777" <% } %> volumes: - "<%= logs_datapath %>:/cnlogs" networks: - cyphernodenet <% if (docker_mode == 'compose') { %> restart: always <% } %> # deploy: # placement: # constraints: [node.hostname==dev] <% if ( features.indexOf('otsclient') !== -1 ) { %> ########################## # OTSCLIENT # ########################## otsclient: image: cyphernode/otsclient:<%= otsclient_version %> command: $USER /script/startotsclient.sh environment: - "TRACING=1" - "OTSCLIENT_LISTENING_PORT=6666" <% if (net === 'testnet') { %> - "TESTNET=1" <% } %> <% if ( features.indexOf('tor') !== -1 && torifyables && torifyables.indexOf('tor_otsoperations') !== -1 ) { %> - "TOR_HOST=tor" - "TOR_PORT=9050" <% } %> volumes: - "<%= logs_datapath %>:/cnlogs" - "<%= otsclient_datapath %>:/otsfiles" - "<%= bitcoin_datapath %>/bitcoin-client.conf:/.bitcoin/bitcoin.conf:ro" command: $USER /script/startotsclient.sh networks: - cyphernodenet <% if (docker_mode == 'compose') { %> restart: always <% } %> # deploy: # placement: # constraints: [node.hostname==dev] <% } %> ########################## # GATEKEEPER # ########################## gatekeeper: # HTTP authentication API gate image: cyphernode/gatekeeper:<%= gatekeeper_version %> command: $USER environment: - "TRACING=1" <% if( gatekeeper_expose ) { %> ports: - "<%= gatekeeper_port %>:<%= gatekeeper_port %>" <% } %> volumes: - "<%= logs_datapath %>:/cnlogs" - "<%= gatekeeper_datapath %>/certs:/etc/ssl/certs:ro" - "<%= gatekeeper_datapath %>/private:/etc/ssl/private:ro" - "<%= gatekeeper_datapath %>/keys.properties:/etc/nginx/conf.d/keys.properties" - "<%= gatekeeper_datapath %>/api.properties:/etc/nginx/conf.d/api.properties" - "<%= gatekeeper_datapath %>/default.conf:/etc/nginx/conf.d/default.conf" - "<%= gatekeeper_datapath %>/htpasswd:/etc/nginx/conf.d/status/htpasswd" - "<%= gatekeeper_datapath %>/installation.json:/etc/nginx/conf.d/s/stats/installation.json" - "<%= gatekeeper_datapath %>/client.7z:/etc/nginx/conf.d/s/stats/client.7z" - "<%= gatekeeper_datapath %>/config.7z:/etc/nginx/conf.d/s/stats/config.7z" networks: - cyphernodenet - cyphernodeappsnet <% if (docker_mode == 'compose') { %> restart: always <% } %> depends_on: - proxy # deploy: # placement: # constraints: [node.hostname==dev] ########################## # TRAEFIK # ########################## traefik: image: traefik:<%= traefik_version %> ports: - <%= traefik_http_port %>:<%= traefik_http_port %> - <%= traefik_https_port %>:<%= traefik_https_port %> volumes: - "/var/run/docker.sock:/var/run/docker.sock" - "<%= traefik_datapath%>/traefik.toml:/traefik.toml:ro" - "<%= traefik_datapath%>/acme.json:/acme.json" - "<%= traefik_datapath%>/htpasswd:/htpasswd/htpasswd:ro" networks: - cyphernodeappsnet <% if (docker_mode == 'compose') { %> restart: always <% } %> depends_on: - gatekeeper # deploy: # placement: # constraints: [node.hostname==dev] volumes: container_monitor: networks: cyphernodenet: external: true cyphernodeappsnet: external: true