diff --git a/Production/nginx.tmpl b/Production/nginx.tmpl index d8db563..3f7c69a 100644 --- a/Production/nginx.tmpl +++ b/Production/nginx.tmpl @@ -191,8 +191,8 @@ proxy_set_header X-Forwarded-Proto https; proxy_pass http://configurator; } - {{ end }} - {{ if (eq $serviceName "nnostr-relay") }} + {{ end }} + {{ if (eq $serviceName "nnostr-relay") }} location /nostr/ { proxy_set_header Connection ""; proxy_set_header Host $host; @@ -207,7 +207,42 @@ proxy_set_header Connection "Upgrade"; proxy_pass http://nnostr-relay; } - {{ end }} + {{ end }} + {{ if (eq $serviceName "mempool_web") }} + location /mempool/ { + proxy_pass http://mempool_web:8080; + + # static API docs + location = /api { + try_files $uri $uri/ /en-US/index.html =404; + } + location = /api/ { + try_files $uri $uri/ /en-US/index.html =404; + } + + # mainnet API + location /api/v1/ws { + proxy_pass http://mempool_api:8999/; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + location /api/v1 { + proxy_pass http://mempool_api:8999/api/v1; + } + location /api/ { + proxy_pass http://mempool_api:8999/api/v1/; + } + + # mainnet API + location /ws { + proxy_pass http://mempool_api:8999/; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + } + {{ end }} {{ end }} {{ end }} diff --git a/docker-compose-generator/docker-fragments/opt-add-electrumx.yml b/docker-compose-generator/docker-fragments/opt-add-electrumx.yml index 3bddd6c..e92d392 100644 --- a/docker-compose-generator/docker-fragments/opt-add-electrumx.yml +++ b/docker-compose-generator/docker-fragments/opt-add-electrumx.yml @@ -4,7 +4,6 @@ services: bitcoind: environment: BITCOIN_EXTRA_ARGS: | - txindex=1 rpcauth=electrumx:7d8ee47c089e6072635f82b34796e878$$13649d99453ccdf78e85007286422599c00e6953289f41bf8e92961076ba14db electrumx: image: lukechilds/electrumx @@ -20,3 +19,5 @@ volumes: electrumx_datadir: incompatible: - pruning +required: + - "opt-txindex" \ No newline at end of file diff --git a/docker-compose-generator/docker-fragments/opt-add-mempool.yml b/docker-compose-generator/docker-fragments/opt-add-mempool.yml new file mode 100644 index 0000000..1830a61 --- /dev/null +++ b/docker-compose-generator/docker-fragments/opt-add-mempool.yml @@ -0,0 +1,68 @@ +version: '3' + +services: + bitcoind: + environment: + BITCOIN_EXTRA_ARGS: | + rpcauth=mempool:d77ee0acf132038f6aaa9d4500d745ec$72cc78dcf18191c91d10c15ff8f7c3dbbd170c4d3107cca35d71c6bf96af2ed9 + mempool_web: + image: mempool/frontend:latest + restart: on-failure + stop_grace_period: 1m + command: "./wait-for mempool_db:3306 --timeout=720 -- nginx -g 'daemon off;'" + expose: + - "8080" + environment: + FRONTEND_HTTP_PORT: "8080" + BACKEND_MAINNET_HTTP_HOST: "mempool_api" + + mempool_api: + image: mempool/backend:latest + restart: on-failure + stop_grace_period: 1m + command: "./wait-for-it.sh db:3306 --timeout=720 --strict -- ./start.sh" + volumes: + - mempool_api_datadir:/backend/cache + environment: + RPC_HOST: "bitcoind" + RPC_PORT: "43782" + RPC_USER: "mempool" + RPC_PASS: "mempool" + ELECTRUM_HOST: "electrumx" + ELECTRUM_PORT: "50002" + ELECTRUM_TLS: "false" + MYSQL_HOST: "mempool_db" + MYSQL_PORT: "3306" + MYSQL_DATABASE: "mempool" + MYSQL_USER: "mempool" + MYSQL_PASS: "mempool" + BACKEND_MAINNET_HTTP_PORT: "8999" + CACHE_DIR: "/backend/cache" + MEMPOOL_CLEAR_PROTECTION_MINUTES: "20" + + mempool_db: + image: mariadb:10.5.8 + restart: on-failure + expose: + - "3306" + volumes: + - "mempool_db_datadir:/var/lib/mysql" + - ./mysql/db-scripts:/docker-entrypoint-initdb.d + environment: + MYSQL_DATABASE: "mempool" + MYSQL_USER: "mempool" + MYSQL_PASSWORD: "mempool" + MYSQL_ROOT_PASSWORD: "admin" + + btcpayserver: + environment: + BTCPAY_EXTERNALSERVICES: "Mempool Explorer:/mempool-explorer" +volumes: + - mempool_db_datadir: + - mempool_api_datadir: + +required: + - opt-add-electrumx + - opt-txindex +incompatible: + - pruning