bitb0x/roles/apps/templates/electrs/Containerfile.j2
b0xxer 249e80e70e Added electrs-init.sh to start with proper arguments for listening
typo in cockpit-storage name

removed task for linger as need to find another way to do it
2024-02-12 10:24:59 -06:00

47 lines
1.0 KiB
Django/Jinja

#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
COPY electrs-init.sh /bin/electrs-init.sh
RUN chmod +x /bin/electrs-init.sh
# 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 [ "/bin/electrs-init.sh" ]