commit f40bcc8ef51e2052f1206092b474b5c03386134c Author: Luke Childs Date: Mon Nov 16 22:44:01 2020 +0700 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1269488 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +data diff --git a/bitcoin.Dockerfile b/bitcoin.Dockerfile new file mode 100644 index 0000000..44d174e --- /dev/null +++ b/bitcoin.Dockerfile @@ -0,0 +1,22 @@ +FROM debian:buster-slim + +WORKDIR /build + +RUN apt-get update + +# Buildtime dependencies +RUN apt-get install -y build-essential libtool autotools-dev automake pkg-config bsdmainutils python3 + +# Runtime dependencies +RUN apt-get install -y libevent-dev libboost-system-dev libboost-filesystem-dev libboost-test-dev libboost-thread-dev + +# Clone source +RUN apt-get install -y git +RUN git clone --branch locations https://github.com/romanz/bitcoin.git . + +# Build +RUN ./autogen.sh +RUN ./configure --disable-wallet --without-gui --without-miniupnpc +RUN make -j"$(($(nproc)+1))" + +ENTRYPOINT ["/build/src/bitcoind"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..c262da2 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,23 @@ +version: '3.7' + +services: + bitcoin: + build: + context: . + dockerfile: bitcoin.Dockerfile + command: "-datadir=/data" + volumes: + - ./data/bitcoin:/data + network_mode: "host" + stop_grace_period: 15m + electrs: + build: + context: . + dockerfile: electrs.Dockerfile + command: "--network mainnet --db-dir /data --daemon-dir /bitcoin --low-memory" + restart: on-failure + volumes: + - ./data/bitcoin:/bitcoin:ro + - ./data/electrs:/data + network_mode: "host" + stop_grace_period: 5m diff --git a/electrs.Dockerfile b/electrs.Dockerfile new file mode 100644 index 0000000..6e224aa --- /dev/null +++ b/electrs.Dockerfile @@ -0,0 +1,19 @@ +FROM debian:buster-slim + +WORKDIR /build + +RUN apt-get update + +# Buildtime dependencies +RUN apt-get install -y cargo clang cmake libsnappy-dev + +# Clone source +RUN apt-get install -y git +RUN git clone --branch next https://github.com/romanz/electrs . + +# Build +RUN cargo build --release + +STOPSIGNAL SIGINT + +ENTRYPOINT ["/build/target/release/electrs_query"]