Skip to content

Commit

Permalink
Merge pull request Blockstream#20 from mempool/docker_build
Browse files Browse the repository at this point in the history
Initial Docker support
  • Loading branch information
softsimon authored Aug 3, 2023
2 parents 46cd53c + bc795f9 commit a19ce10
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Dockerfile
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
24 changes: 24 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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:
Empty file added electrs_data/.gitkeep
Empty file.

0 comments on commit a19ce10

Please sign in to comment.