Initial version of electrs - not working

This commit is contained in:
2024-02-11 17:55:20 -06:00
parent c93df6d0d3
commit 7cd72b6f87
6 changed files with 62 additions and 5 deletions
@@ -0,0 +1,42 @@
#Adapted from iangregsondev - https://github.com/iangregsondev/electrs-docker/blob/main/Dockerfile
#FROM rust:1.44.1-slim-buster AS builder
FROM docker.io/almalinux/9-base:latest as builder
ARG VERSION=v{{ electrs_version }}
ENV REPO=https://github.com/romanz/electrs.git
WORKDIR /build
RUN dnf update -y && dnf install -y dnf-plugins-core && dnf config-manager --set-enabled crb && dnf update -y \
&& dnf install -y git cargo clang cmake snappy-devel
RUN git clone --branch $VERSION $REPO .
RUN cargo build --release --bin electrs
#FROM debian:buster-slim
FROM docker.io/almalinux/9-minimal:latest
RUN microdnf update -y && microdnf clean all
COPY --from=builder /build/target/release/electrs /bin/electrs
# Electrum RPC Mainnet
EXPOSE 50001
# Electrum RPC Testnet
EXPOSE 60001
# Electrum RPC Regtest
EXPOSE 60401
# Prometheus monitoring
EXPOSE 4224
STOPSIGNAL SIGINT
HEALTHCHECK CMD curl -fSs http://localhost:4224/ || exit 1
ENTRYPOINT [ "electrs" ]
+6
View File
@@ -0,0 +1,6 @@
#!/bin/sh
#Build command to make container
VER={{electrs_version}}
buildah build -t electrs:$VER --build-arg VERSION=v$VER -f Containerfile
@@ -0,0 +1,21 @@
[Unit]
Description=Electrs Server
[Container]
Image={{ registry_url }}/electrs:{{ electrs_version }}
PodmanArgs=--pod bitcoin-pod
# Use volume
Volume=/home/{{ansible_user}}/.bitcoin:/bitcoin/.bitcoin:Z
[Service]
# Restart service when sleep finishes
Restart=always
# Extend Timeout to allow time to pull the image
TimeoutStartSec=900
# ExecStartPre flag and other systemd commands can go here, see systemd.unit(5) man page.
# ExecStartPre=/usr/share/mincontainer/setup.sh
[Install]
# Start by default on boot
WantedBy=multi-user.target default.target