From 9b9893d0a5204a0a3b15e5b4ef98e7673e4694ea Mon Sep 17 00:00:00 2001 From: sahaj05 <135546365+sahaj05@users.noreply.github.com> Date: Fri, 1 Sep 2023 13:00:34 +0530 Subject: [PATCH 1/4] Add files via upload --- Dockerfile | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bfef303 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM ubuntu:latest +WORKDIR /app +COPY . /app +RUN apt-get update && apt-get install -y \ + git \ + python3 \ + python3-pip +RUN git clone https://github.com/trezor/blockbook.git +WORKDIR /app/blockbook + From 79fc0c67afa0d203aa0168c51e697df8db3ad01b Mon Sep 17 00:00:00 2001 From: sahaj05 <135546365+sahaj05@users.noreply.github.com> Date: Wed, 6 Sep 2023 17:17:51 +0530 Subject: [PATCH 2/4] Update Dockerfile --- Dockerfile | 53 ++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 44 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index bfef303..32fc1c7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,45 @@ -FROM ubuntu:latest -WORKDIR /app -COPY . /app -RUN apt-get update && apt-get install -y \ - git \ - python3 \ - python3-pip -RUN git clone https://github.com/trezor/blockbook.git -WORKDIR /app/blockbook +# Use a base Ubuntu image +FROM ubuntu:20.04 + +# Set environment variables to avoid interaction during installation +ENV DEBIAN_FRONTEND=noninteractive + +# Install required packages +RUN apt-get update && \ + apt-get install -y \ + git \ + build-essential \ + cmake \ + libtool \ + autoconf \ + automake \ + pkg-config \ + libssl-dev \ + libsqlite3-dev \ + libboost-all-dev \ + libcurl4-openssl-dev \ + golang \ + npm \ + curl + +# Clone the blockbook repository +RUN git clone https://github.com/ranchimall/blockbook /opt/blockbook + +# Build the blockbook files +WORKDIR /opt/blockbook +RUN make deb-flo + +# Install the backend and blockbook services +RUN apt-get install -y ./blockbook-flo*.deb && \ + apt-get install -y ./backend-flo*.deb + +# Start the backend service +RUN systemctl start backend-flo.service + +# Expose the blockbook port +EXPOSE 9166 + +# Start the blockbook service +CMD ["systemctl", "start", "blockbook-flo.service"] + From c348055ee58f4ae3b1d84b862ba76e2eedbee709 Mon Sep 17 00:00:00 2001 From: Kumar Sahaj Date: Wed, 6 Sep 2023 18:18:47 +0000 Subject: [PATCH 3/4] commit chages to docker file in which we are directly accessing and running the dev files --- Dockerfile | 53 +++++++++++++++++------------------------------------ 1 file changed, 17 insertions(+), 36 deletions(-) diff --git a/Dockerfile b/Dockerfile index 32fc1c7..c7b8fd7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,45 +1,26 @@ -# Use a base Ubuntu image +# Use a base image FROM ubuntu:20.04 -# Set environment variables to avoid interaction during installation -ENV DEBIAN_FRONTEND=noninteractive - -# Install required packages +# Install necessary packages RUN apt-get update && \ - apt-get install -y \ - git \ - build-essential \ - cmake \ - libtool \ - autoconf \ - automake \ - pkg-config \ - libssl-dev \ - libsqlite3-dev \ - libboost-all-dev \ - libcurl4-openssl-dev \ - golang \ - npm \ - curl + apt-get install -y wget && \ + apt-get install -y gnupg2 && \ + apt-get install -y software-properties-common -# Clone the blockbook repository -RUN git clone https://github.com/ranchimall/blockbook /opt/blockbook +# Download the pre-built files from GitHub releases +RUN wget https://github.com/ranchimall/blockbook/releases/download/v0.4.0/blockbook-flo_0.4.0_amd64.deb && \ + wget https://github.com/ranchimall/blockbook/releases/download/v0.15.1.1/backend-flo_0.15.1.1-satoshilabs-1_amd64.deb -# Build the blockbook files -WORKDIR /opt/blockbook -RUN make deb-flo +# Install the downloaded packages +RUN apt install -y ./backend-flo_0.15.1.1-satoshilabs-1_amd64.deb && \ + apt install -y ./blockbook-flo_0.4.0_amd64.deb -# Install the backend and blockbook services -RUN apt-get install -y ./blockbook-flo*.deb && \ - apt-get install -y ./backend-flo*.deb +# Clean up downloaded packages +RUN rm -f ./backend-flo_0.15.1.1-satoshilabs-1_amd64.deb && \ + rm -f ./blockbook-flo_0.4.0_amd64.deb -# Start the backend service -RUN systemctl start backend-flo.service - -# Expose the blockbook port +# Expose the port for the Blockbook web interface EXPOSE 9166 -# Start the blockbook service -CMD ["systemctl", "start", "blockbook-flo.service"] - - +# Start the Blockbook service +CMD ["/usr/local/bin/blockbook", "--config", "/etc/blockbook/blockbook-flo.cfg"] \ No newline at end of file From a264c7e7175f657d4ae45bc1fb2803e450a5ac6a Mon Sep 17 00:00:00 2001 From: Kumar Sahaj Date: Wed, 6 Sep 2023 18:51:30 +0000 Subject: [PATCH 4/4] fixed the url for deb files --- Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index c7b8fd7..843e3a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,9 +8,8 @@ RUN apt-get update && \ apt-get install -y software-properties-common # Download the pre-built files from GitHub releases -RUN wget https://github.com/ranchimall/blockbook/releases/download/v0.4.0/blockbook-flo_0.4.0_amd64.deb && \ - wget https://github.com/ranchimall/blockbook/releases/download/v0.15.1.1/backend-flo_0.15.1.1-satoshilabs-1_amd64.deb - +RUN wget https://github.com/ranchimall/blockbook/releases/download/flo-v0.4.0-ubuntu/backend-flo_0.15.1.1-satoshilabs-1_amd64.deb && \ + wget https://github.com/ranchimall/blockbook/releases/download/flo-v0.4.0-ubuntu/blockbook-flo_0.4.0_amd64.deb # Install the downloaded packages RUN apt install -y ./backend-flo_0.15.1.1-satoshilabs-1_amd64.deb && \ apt install -y ./blockbook-flo_0.4.0_amd64.deb