Initial Docker support

This commit is contained in:
Felipe Knorr Kuhn 2023-07-23 18:07:39 +09:00
parent 8d2ff11e0a
commit c222efb9d6
No known key found for this signature in database
GPG Key ID: 79619B52BB097C1A
3 changed files with 45 additions and 0 deletions

21
Dockerfile Normal file
View File

@ -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
docker-compose.yml Normal file
View File

@ -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:

0
electrs_data/.gitkeep Normal file
View File