diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..b57becdc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM debian:bookworm-slim AS base + +RUN apt update -qy +RUN apt install -qy librocksdb-dev + +FROM base as build + +RUN apt install -qy git cargo clang cmake + +WORKDIR /build +COPY . . + +RUN cargo build --release --bin electrs + +FROM base as deploy + +COPY --from=build /build/target/release/electrs /bin/electrs + +EXPOSE 50001 + +ENTRYPOINT ["/bin/electrs"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..f6fe6dc6 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,24 @@ +version: '3.9' +services: + + mempool-electrs: + build: + context: . + dockerfile: Dockerfile + restart: on-failure + + ports: + - 50001:50001 + + entrypoint: + /bin/electrs + command: | + --address-search + --cookie mempool:mempool + --db-dir /electrs + --cors '*' + volumes: + - 'electrs_data:/electrs' + +volumes: + electrs_data: \ No newline at end of file diff --git a/electrs_data/.gitkeep b/electrs_data/.gitkeep new file mode 100644 index 00000000..e69de29b