mirror of
https://github.com/mempool/mempool.git
synced 2025-03-03 17:47:01 +01:00
Update Docker README file
This commit is contained in:
parent
6cb2625303
commit
bfb5abaa71
1 changed files with 38 additions and 75 deletions
113
docker/README.md
113
docker/README.md
|
@ -1,96 +1,59 @@
|
||||||
# Docker
|
# Docker
|
||||||
|
|
||||||
## Initialization
|
This directory contains the Dockerfiles used to build and release the official images and a `docker-compose.yml` file that is intended for end users to run a Mempool instance with minimal effort.
|
||||||
|
|
||||||
In an empty dir create 2 sub-dirs
|
## Basic setup
|
||||||
|
|
||||||
|
To run an instance with the default settings, use the following command:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
mkdir -p data mysql/data
|
$ docker-compose up
|
||||||
```
|
```
|
||||||
|
|
||||||
Your dir should now look like that:
|
The default configuration will allow you to run Mempool using `bitcoind` as the backend, so address lookups will be disabled.
|
||||||
|
|
||||||
```bash
|
You can check if the instance is running by visiting http://localhost - the graphs will be populated as new transactions are detected.
|
||||||
$ls -R
|
|
||||||
.:
|
|
||||||
data mysql
|
|
||||||
|
|
||||||
./data:
|
## Advanced setup
|
||||||
|
|
||||||
./mysql:
|
In order to run with electrum/electrs as the backend you will need to make the following changes to the `docker-compose.yml` file:
|
||||||
data db-scripts
|
|
||||||
|
- Under the `api` service, change the value of `MEMPOOL_BACKEND` key from `none` to `electrum`:
|
||||||
|
|
||||||
./mysql/data:
|
|
||||||
```
|
```
|
||||||
|
|
||||||
In the main dir add the following `docker-compose.yml`
|
|
||||||
|
|
||||||
```bash
|
|
||||||
version: "3.7"
|
|
||||||
|
|
||||||
services:
|
|
||||||
web:
|
|
||||||
image: mempool/frontend:latest
|
|
||||||
user: "1000:1000"
|
|
||||||
restart: on-failure
|
|
||||||
stop_grace_period: 1m
|
|
||||||
command: "./wait-for db:3306 --timeout=720 -- nginx -g 'daemon off;'"
|
|
||||||
ports:
|
|
||||||
- 80:8080
|
|
||||||
environment:
|
|
||||||
FRONTEND_HTTP_PORT: "8080"
|
|
||||||
BACKEND_MAINNET_HTTP_HOST: "api"
|
|
||||||
api:
|
api:
|
||||||
image: mempool/backend:latest
|
|
||||||
user: "1000:1000"
|
|
||||||
restart: on-failure
|
|
||||||
stop_grace_period: 1m
|
|
||||||
command: "./wait-for-it.sh db:3306 --timeout=720 --strict -- ./start.sh"
|
|
||||||
volumes:
|
|
||||||
- ./data:/backend/cache
|
|
||||||
environment:
|
environment:
|
||||||
RPC_HOST: "127.0.0.1"
|
MEMPOOL_BACKEND: "none"
|
||||||
RPC_PORT: "8332"
|
```
|
||||||
RPC_USER: "mempool"
|
|
||||||
RPC_PASS: "mempool"
|
- Under the `api` service, set the `ELECTRUM_HOST` and `ELECTRUM_PORT` keys to your Docker host ip address and set `ELECTRUM_TLS_ENABLED` to `false`:
|
||||||
ELECTRUM_HOST: "127.0.0.1"
|
|
||||||
|
```
|
||||||
|
api:
|
||||||
|
environment:
|
||||||
|
ELECTRUM_HOST: "172.27.0.1"
|
||||||
ELECTRUM_PORT: "50002"
|
ELECTRUM_PORT: "50002"
|
||||||
ELECTRUM_TLS: "false"
|
ELECTRUM_TLS: "false"
|
||||||
MYSQL_HOST: "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"
|
|
||||||
db:
|
|
||||||
image: mariadb:10.5.8
|
|
||||||
user: "1000:1000"
|
|
||||||
restart: on-failure
|
|
||||||
stop_grace_period: 1m
|
|
||||||
volumes:
|
|
||||||
- ./mysql/data:/var/lib/mysql
|
|
||||||
- ./mysql/db-scripts:/docker-entrypoint-initdb.d
|
|
||||||
environment:
|
|
||||||
MYSQL_DATABASE: "mempool"
|
|
||||||
MYSQL_USER: "mempool"
|
|
||||||
MYSQL_PASSWORD: "mempool"
|
|
||||||
MYSQL_ROOT_PASSWORD: "admin"
|
|
||||||
|
|
||||||
```
|
You can update any of the settings in the `mempool-config.json` file using the environment variables to override. Refer to the `start.sh` script for a list of variables and their default values.
|
||||||
|
|
||||||
You can update all the environment variables inside the API container, especially the RPC and ELECTRUM ones
|
## Troubleshooting
|
||||||
|
|
||||||
## Run it
|
If you already have something running on port 80, change it to something else under the `web` service section.
|
||||||
|
|
||||||
To run our docker-compose use the following cmd:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker-compose up
|
|
||||||
```
|
|
||||||
|
|
||||||
If everything went okay you should see the beautiful mempool :grin:
|
|
||||||
|
|
||||||
If you get stuck on "loading blocks", this means the websocket can't connect.
|
If you get stuck on "loading blocks", this means the websocket can't connect.
|
||||||
Check your nginx proxy setup, firewalls, etc. and open an issue if you need help.
|
|
||||||
|
If you can't connect to the `bitcoind` RPC server, check your firewall settings and your `bitcoin.conf` file, it should contain at least these settings:
|
||||||
|
|
||||||
|
```
|
||||||
|
rpcallowip=0.0.0.0/0
|
||||||
|
rpcuser=mempool
|
||||||
|
rpcpassword=mempool
|
||||||
|
bind=0.0.0.0:8333
|
||||||
|
rpcbind=0.0.0.0:8332
|
||||||
|
```
|
||||||
|
|
||||||
|
If you can't connect to electrum/electrs, check your firewall settings and the IP you entered.
|
||||||
|
|
||||||
|
If you see a permission denied error coming from the database container, check your filesystem. The cache files generated by the backend will be stored in the `./data` directory and the database will be stored in the `./mysql/data` directory relative to the location of the `docker-compose.yml` file. If you move it somewhere, the paths will have to be updated and/or recreated.
|
||||||
|
|
Loading…
Add table
Reference in a new issue