I'm a newbie in the Docker world, but I was recently able to setup:
a Peercoin fork in Testnet on RPC port 9904
its ElectrumX server with default TCP port 50001
both running on Docker (on a machine with Ubuntu 20.04).
The btc-rpc-explorer will be available on port 80 of the server's domain.
I want to provide the Dockerfile and commands I used as an example to run btc-rpc-explorer (that I adapted for my Peercoin fork) with these two services, hoping that will be usefull for someone, even though I'm not sure this is the best way:
Dockerfile:
FROM node:16.6.1-alpine3.12
RUN apk --no-cache add git
RUN git clone --single-branch --branch master \
https://github.com/lorenz10/btc-rpc-explorer.git btc-rpc-explorer
WORKDIR /btc-rpc-explorer
RUN echo -e 'BTCEXP_BITCOIND_HOST=host.docker.internal \
\nBTCEXP_BITCOIND_PORT=9904 \nBTCEXP_BITCOIND_USER=<USER> \
\nBTCEXP_BITCOIND_PASS=<PASSWORD> \nBTCEXP_BITCOIND_RPC_TIMEOUT=10000 \
\nBTCEXP_ADDRESS_API=electrum \
\nBTCEXP_ELECTRUM_SERVERS=tcp://host.docker.internal:50001 \
\nBTCEXP_HOST=0.0.0.0 \nBTCEXP_PORT=80' > .env
RUN npm install
CMD npm start
EXPOSE 80
Docker Image: docker build -t btc-rpc-explorer .
Docker Container docker run -it -p 80:80 -d btc-rpc-explorer adding also --add-host=host.docker.internal:host-gateway if the guest OS is Linux.
I'm a newbie in the Docker world, but I was recently able to setup:
The btc-rpc-explorer will be available on port 80 of the server's domain.
I want to provide the Dockerfile and commands I used as an example to run btc-rpc-explorer (that I adapted for my Peercoin fork) with these two services, hoping that will be usefull for someone, even though I'm not sure this is the best way:
Dockerfile:
Docker Image:
docker build -t btc-rpc-explorer .
Docker Containerdocker run -it -p 80:80 -d btc-rpc-explorer
adding also--add-host=host.docker.internal:host-gateway
if the guest OS is Linux.