Add docs re using Docker DNS instead of container IPs (#197)

Co-authored-by: Steven Briscoe <me@stevenbriscoe.com>
This commit is contained in:
Steven Briscoe 2022-10-13 15:27:05 +11:00 committed by GitHub
parent ad980846c7
commit 19d19097d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 22 deletions

View File

@ -104,7 +104,10 @@ version: "3.7"
services: services:
app_proxy: app_proxy:
environment: environment:
APP_HOST: <web-container-ip-address> # <app-id>_<web-container-name>_1
# e.g. 'btc-rpc-explorer_web_1'
# Note that the '_1' at the end is needed
APP_HOST: <web-container-dns-name>
APP_PORT: <web-container-port-number> APP_PORT: <web-container-port-number>
web: 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 `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 ```sh
export APP_BTC_RPC_EXPLORER_IP="10.21.21.12" export APP_BTC_RPC_EXPLORER_ADDRESS_API="electrumx"
export APP_BTC_RPC_EXPLORER_PORT="3002"
``` ```
4\. For our app, we'll update `<docker-image>` with `getumbrel/btc-rpc-explorer`, `<tag>` with `v2.0.2`, and `<port>` 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. 4\. For our app, we'll update `<docker-image>` with `getumbrel/btc-rpc-explorer`, `<tag>` with `v2.0.2`, and `<port>` 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: services:
app_proxy: app_proxy:
environment: environment:
APP_HOST: $APP_BTC_RPC_EXPLORER_IP APP_HOST: btc-rpc-explorer_web_1
APP_PORT: $APP_BTC_RPC_EXPLORER_PORT APP_PORT: 8080
web: web:
image: getumbrel/btc-rpc-explorer:v2.0.2 image: getumbrel/btc-rpc-explorer:v2.0.2
restart: on-failure restart: on-failure
stop_grace_period: 1m stop_grace_period: 1m
environment: ... environment:
networks: BTCEXP_PORT: 8080
default:
ipv4_address: $APP_BTC_RPC_EXPLORER_IP
``` ```
@ -243,14 +244,16 @@ version: "3.7"
services: services:
app_proxy: app_proxy:
environment: environment:
APP_HOST: $APP_BTC_RPC_EXPLORER_IP APP_HOST: btc-rpc-explorer_web_1
APP_PORT: $APP_BTC_RPC_EXPLORER_PORT APP_PORT: 8080
web: web:
image: getumbrel/btc-rpc-explorer:v2.0.2 image: getumbrel/btc-rpc-explorer:v2.0.2
restart: on-failure restart: on-failure
stop_grace_period: 1m stop_grace_period: 1m
environment: environment:
PORT: 8080
# Bitcoin Core connection details # Bitcoin Core connection details
BTCEXP_BITCOIND_HOST: $APP_BITCOIN_NODE_IP BTCEXP_BITCOIND_HOST: $APP_BITCOIN_NODE_IP
BTCEXP_BITCOIND_PORT: $APP_BITCOIN_RPC_PORT BTCEXP_BITCOIND_PORT: $APP_BITCOIN_RPC_PORT
@ -270,9 +273,6 @@ services:
BTCEXP_NO_RATES: "true" BTCEXP_NO_RATES: "true"
BTCEXP_RPC_ALLOWALL: "false" BTCEXP_RPC_ALLOWALL: "false"
BTCEXP_BASIC_AUTH_PASSWORD: "" BTCEXP_BASIC_AUTH_PASSWORD: ""
networks:
default:
ipv4_address: $APP_BTC_RPC_EXPLORER_IP
``` ```

View File

@ -3,8 +3,8 @@ version: "3.7"
services: services:
app_proxy: app_proxy:
environment: environment:
APP_HOST: $APP_BTC_RPC_EXPLORER_IP APP_HOST: btc-rpc-explorer_web_1
APP_PORT: $APP_BTC_RPC_EXPLORER_PORT APP_PORT: 8080
web: web:
image: getumbrel/btc-rpc-explorer:v3.3.0@sha256:cfd14f8e722cfbf1ad106ba224569c8babe685422461a641abc210e13913c636 image: getumbrel/btc-rpc-explorer:v3.3.0@sha256:cfd14f8e722cfbf1ad106ba224569c8babe685422461a641abc210e13913c636
@ -13,6 +13,7 @@ services:
environment: environment:
# Docker requirements # Docker requirements
BTCEXP_HOST: 0.0.0.0 BTCEXP_HOST: 0.0.0.0
BTCEXP_PORT: 8080
# Bitcoin Core # Bitcoin Core
BTCEXP_BITCOIND_HOST: $APP_BITCOIN_NODE_IP BTCEXP_BITCOIND_HOST: $APP_BITCOIN_NODE_IP
BTCEXP_BITCOIND_PORT: $APP_BITCOIN_RPC_PORT BTCEXP_BITCOIND_PORT: $APP_BITCOIN_RPC_PORT
@ -32,6 +33,3 @@ services:
# Disable RPC # Disable RPC
BTCEXP_RPC_ALLOWALL: "false" BTCEXP_RPC_ALLOWALL: "false"
BTCEXP_BASIC_AUTH_PASSWORD: "" BTCEXP_BASIC_AUTH_PASSWORD: ""
networks:
default:
ipv4_address: $APP_BTC_RPC_EXPLORER_IP

View File

@ -1,2 +0,0 @@
export APP_BTC_RPC_EXPLORER_IP="10.21.21.12"
export APP_BTC_RPC_EXPLORER_PORT="3002"