From 95393696ed71e473059d81e8dc8711cf42e278fc Mon Sep 17 00:00:00 2001 From: Vivek Teega Date: Tue, 2 Jul 2024 15:52:47 +0530 Subject: [PATCH] Updated Readme, added comments, minor changes and cleanup --- .env.example | 8 +++++--- README.md | 28 +++++++++------------------- docker-compose.yml | 8 ++++---- 3 files changed, 18 insertions(+), 26 deletions(-) diff --git a/.env.example b/.env.example index fa07bfb..2c1cfe4 100644 --- a/.env.example +++ b/.env.example @@ -2,9 +2,11 @@ BACKEND_IMAGE=vivekteega/blockbook:1.0.0 FRONTEND_IMAGE=vivekteega/blockbook:1.0.0 BACKEND_CONTAINER_NAME=blockbook-backend FRONTEND_CONTAINER_NAME=blockbook-frontend -BACKEND_BOOTSTRAP_FILE=/path/to/your/bootstrap-blockbook-flo-mainnet-backend.tar.gz -FRONTEND_BOOTSTRAP_FILE=/path/to/your/bootstrap-blockbook-flo-mainnet-frontend.tar.gz +BACKEND_BOOTSTRAP_FILE=/path/to/your/bootstrap-blockbook-flo-mainnet-backend.tar.gz # Set to empty string if not provided +FRONTEND_BOOTSTRAP_FILE=/path/to/your/bootstrap-blockbook-flo-mainnet-frontend.tar.gz # Set to empty string if not provided +BACKEND_BOOTSTRAP_URL=/path/to/your/bootstrap-blockbook-flo-mainnet-backend.tar.gz # Set to empty string if not provided +FRONTEND_BOOTSTRAP_URL=/path/to/your/bootstrap-blockbook-flo-mainnet-frontend.tar.gz # Set to empty string if not provided BACKEND_PORT_1=38366 BACKEND_PORT_2=8066 FRONTEND_PORT_1=9166 -FRONTEND_PORT_2=9066 +FRONTEND_PORT_2=9066 \ No newline at end of file diff --git a/README.md b/README.md index 66a261f..ec231a8 100644 --- a/README.md +++ b/README.md @@ -2,20 +2,22 @@ ## Roadmap for upgrade -- [X] [Unable to build frontend separately since having backend package installed is a dependency] Create separate images for both backend and blockbook. -- [X] Attach the same volume to both the running containers of the images. -- [ ] Think of how Blockbook container will detect the spots of backend container -- [ ] Figure out if multiple volume path need to be mounted -- [ ] See if creating a new network for both the containers will be a good option. +- [ ] How to set this up in production +- [ ] Think of how Blockbook container will detect the status of backend container +- [ ] Figure out if multiple volume path need to be mounted +- [ ] See if creating a new network for both the containers will be a good option. +- [X] [Unable to build frontend separately since having backend package installed is a dependency] Create separate images for both backend and blockbook. +- [X] Attach the same volume to both the running containers of the images. ## Quickstart -To run the services using this file, run the following command in the same directory: + +To run the services using this file create a .env file using .env.example file, fill info and run the following command in the same directory: ``` sudo docker-compose up -d ``` -## Building and running blockbook image +## Running blockbook manually ``` @@ -43,15 +45,3 @@ docker run -d --name blockbook-frontend --mount source=blockbook,target=/opt -p docker run -d --name blockbook-frontend --mount source=blockbook,target=/opt -p 9166:9166 -p 9066:9066 --network=blockbook --env BOOTSTRAP_URL=https://bootstrap.ranchimall.net/blockbook-flo-frontend.tar.gz vivekteega/blockbook:1.0.0 frontend 172.20.0.2 ``` - -## Building & running backend image - -``` -docker build -t vivekteega/blockbook-backend:1.0.0 -f Dockerfile_backend . - -docker volume create blockbook - -docker run -it --mount source=blockbook,target=/opt/coins -p vivekteega/blockbook-backend:1.0. - -docker run -d --mount source=blockbook,target=/opt/coins -p 38366:38366 -p 8066:8066 vivekteega/blockbook-backend:1.0.0 -``` \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index da16422..410aaae 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,8 +14,8 @@ services: - "${BACKEND_PORT_2}:8066" command: backend environment: - - BOOTSTRAP_FILE=/local-bootstrap/bootstrap-blockbook-flo-mainnet-backend.tar.gz - - BOOTSTRAP_URL=${BOOTSTRAP_URL:-} # Set to empty string if not provided + - BOOTSTRAP_FILE=/local-bootstrap/bootstrap-blockbook-flo-mainnet-backend.tar.gz # Set to empty string if not provided + - BOOTSTRAP_URL=${BACKEND_BOOTSTRAP_URL:-} # Set to empty string if not provided blockbook-frontend: image: ${FRONTEND_IMAGE} @@ -34,8 +34,8 @@ services: command: > "/opt/entrypoint.sh frontend $(getent hosts blockbook-backend | awk '{ print $1 }')" environment: - - BOOTSTRAP_FILE=/local-bootstrap/bootstrap-blockbook-flo-mainnet-frontend.tar.gz - - BOOTSTRAP_URL=${BOOTSTRAP_URL:-} # Set to empty string if not provided + - BOOTSTRAP_FILE=/local-bootstrap/bootstrap-blockbook-flo-mainnet-frontend.tar.gz # Set to empty string if not provided + - BOOTSTRAP_URL=${FRONTEND_BOOTSTRAP_URL:-} # Set to empty string if not provided volumes: blockbook: