This guide will help you build and run the Docker image for Blockbook (Mainnet), which is based on Ubuntu 22.04 and includes both backend and frontend components.
- Docker installed on your machine.
- Clone or download the repository to your local machine.
Navigate to the directory where the repository is cloned or downloaded:
cd <path/to/cloned/repository>
Build the Docker image using the following command:
docker build -t <imagename> .
Create a named volume for Persistent storage using:
docker volume create <volume_name>
Run the Docker container in detached mode and map port 9166
on your host to port 9166
on the container:
docker run -d -p 9166:9166 --mount source=<volume_name>,target=/opt/coins <imagename>
Once the Docker container is running, you can access the frontend of the application by navigating to:
https://localhost:9166
in your web browser.
To check the logs, you can access the container shell and use the tail
command.
First, get the container's name or ID:
docker ps -a
Then, access the container shell:
docker exec -it <containername> bash
To view the backend logs, run:
tail -f /opt/coins/data/flo/backend/debug.log
To view the frontend logs, run:
tail -f /opt/coins/blockbook/flo/logs/blockbook.INFO
-
Stopping the Docker Container:
To stop the container, use:
docker stop <containername>
-
Removing the Docker Container:
To remove the container, use:
docker rm <containername>
-
Removing the Docker Image:
To remove the image, use:
docker rmi <imagename>
Replace <path/to/cloned/repository>
, <imagename>
, and <containername>
with the actual path, image name, and container name or ID, respectively.
-
Ensure that no other application is using port
9166
on your host machine. -
If you encounter issues, check the Docker container logs:
docker logs <containername>