From 19d19097d21aec7dc88b4f1d216b6339dea91843 Mon Sep 17 00:00:00 2001 From: Steven Briscoe Date: Thu, 13 Oct 2022 15:27:05 +1100 Subject: [PATCH] Add docs re using Docker DNS instead of container IPs (#197) Co-authored-by: Steven Briscoe --- README.md | 30 ++++++++++++++--------------- btc-rpc-explorer/docker-compose.yml | 8 +++----- btc-rpc-explorer/exports.sh | 2 -- 3 files changed, 18 insertions(+), 22 deletions(-) delete mode 100644 btc-rpc-explorer/exports.sh diff --git a/README.md b/README.md index 59a6419d..1fd41e2d 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,10 @@ version: "3.7" services: app_proxy: environment: - APP_HOST: + # __1 + # e.g. 'btc-rpc-explorer_web_1' + # Note that the '_1' at the end is needed + APP_HOST: APP_PORT: web: @@ -198,11 +201,11 @@ defaultPassword: "" The `dependencies` section within the app manifest gives Umbrel a list of app IDs that must be already installed in order for the user to install BTC RPC Explorer and also function. -The `exports.sh` shell script is a simple script to export environmental variables that your `docker-compose.yml` can read. These env. vars. are also accessible when other apps start through their `docker-compose.yml` files. +The `exports.sh` shell script is a simple script to export environmental variables that your `docker-compose.yml` can read. These env. vars. are also accessible when other apps start through their `docker-compose.yml` files. Most applications will not require this feature. +If we (for example) wanted to share BTC RPC Explorer's Address API with other apps; that would look like this: ```sh -export APP_BTC_RPC_EXPLORER_IP="10.21.21.12" -export APP_BTC_RPC_EXPLORER_PORT="3002" +export APP_BTC_RPC_EXPLORER_ADDRESS_API="electrumx" ``` 4\. For our app, we'll update `` with `getumbrel/btc-rpc-explorer`, `` with `v2.0.2`, and `` with `3002`. Since BTC RPC Explorer doesn't need to store any persistent data and doesn't require access to Bitcoin Core's or LND's data directories, we can remove the entire `volumes` block. @@ -219,17 +222,15 @@ version: "3.7" services: app_proxy: environment: - APP_HOST: $APP_BTC_RPC_EXPLORER_IP - APP_PORT: $APP_BTC_RPC_EXPLORER_PORT + APP_HOST: btc-rpc-explorer_web_1 + APP_PORT: 8080 web: image: getumbrel/btc-rpc-explorer:v2.0.2 restart: on-failure stop_grace_period: 1m - environment: ... - networks: - default: - ipv4_address: $APP_BTC_RPC_EXPLORER_IP + environment: + BTCEXP_PORT: 8080 ``` @@ -243,14 +244,16 @@ version: "3.7" services: app_proxy: environment: - APP_HOST: $APP_BTC_RPC_EXPLORER_IP - APP_PORT: $APP_BTC_RPC_EXPLORER_PORT + APP_HOST: btc-rpc-explorer_web_1 + APP_PORT: 8080 web: image: getumbrel/btc-rpc-explorer:v2.0.2 restart: on-failure stop_grace_period: 1m environment: + PORT: 8080 + # Bitcoin Core connection details BTCEXP_BITCOIND_HOST: $APP_BITCOIN_NODE_IP BTCEXP_BITCOIND_PORT: $APP_BITCOIN_RPC_PORT @@ -270,9 +273,6 @@ services: BTCEXP_NO_RATES: "true" BTCEXP_RPC_ALLOWALL: "false" BTCEXP_BASIC_AUTH_PASSWORD: "" - networks: - default: - ipv4_address: $APP_BTC_RPC_EXPLORER_IP ``` diff --git a/btc-rpc-explorer/docker-compose.yml b/btc-rpc-explorer/docker-compose.yml index 75162861..bf261cc4 100644 --- a/btc-rpc-explorer/docker-compose.yml +++ b/btc-rpc-explorer/docker-compose.yml @@ -3,8 +3,8 @@ version: "3.7" services: app_proxy: environment: - APP_HOST: $APP_BTC_RPC_EXPLORER_IP - APP_PORT: $APP_BTC_RPC_EXPLORER_PORT + APP_HOST: btc-rpc-explorer_web_1 + APP_PORT: 8080 web: image: getumbrel/btc-rpc-explorer:v3.3.0@sha256:cfd14f8e722cfbf1ad106ba224569c8babe685422461a641abc210e13913c636 @@ -13,6 +13,7 @@ services: environment: # Docker requirements BTCEXP_HOST: 0.0.0.0 + BTCEXP_PORT: 8080 # Bitcoin Core BTCEXP_BITCOIND_HOST: $APP_BITCOIN_NODE_IP BTCEXP_BITCOIND_PORT: $APP_BITCOIN_RPC_PORT @@ -32,6 +33,3 @@ services: # Disable RPC BTCEXP_RPC_ALLOWALL: "false" BTCEXP_BASIC_AUTH_PASSWORD: "" - networks: - default: - ipv4_address: $APP_BTC_RPC_EXPLORER_IP diff --git a/btc-rpc-explorer/exports.sh b/btc-rpc-explorer/exports.sh deleted file mode 100644 index 19293c4b..00000000 --- a/btc-rpc-explorer/exports.sh +++ /dev/null @@ -1,2 +0,0 @@ -export APP_BTC_RPC_EXPLORER_IP="10.21.21.12" -export APP_BTC_RPC_EXPLORER_PORT="3002" \ No newline at end of file