Skip to content

Commit

Permalink
Initial Docker support
Browse files Browse the repository at this point in the history
  • Loading branch information
knorrium committed Jul 23, 2023
1 parent 8d2ff11 commit c222efb
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
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 c222efb

Please sign in to comment.