forked from chrisguida/electrs-wrapper
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathDockerfile
55 lines (43 loc) · 1.53 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
FROM rust:1.83-slim-bookworm AS builder
RUN apt-get update -qqy && \
apt-get upgrade -qqy && \
DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends \
clang \
cmake \
librocksdb-dev && \
rm -rf /var/lib/apt/lists/* /var/cache/apt/*
WORKDIR /build
COPY ./electrs .
ENV ROCKSDB_INCLUDE_DIR=/usr/include
ENV ROCKSDB_LIB_DIR=/usr/lib
RUN rustup toolchain install stable
RUN cargo +stable install --locked --path .
FROM debian:bookworm-slim AS final
RUN apt-get update -qqy && \
apt-get upgrade -qqy && \
DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends \
bash \
curl \
tini \
netcat-openbsd \
ca-certificates \
librocksdb7.8 && \
rm -rf /var/lib/apt/lists/* /var/cache/apt/*
ARG ARCH
ARG PLATFORM
RUN curl -sLo /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_${PLATFORM} && chmod +x /usr/local/bin/yq
COPY --from=builder /usr/local/cargo/bin/electrs /bin/electrs
ADD ./configurator/target/${ARCH}-unknown-linux-musl/release/configurator /usr/local/bin/configurator
ADD ./docker_entrypoint.sh /usr/local/bin/docker_entrypoint.sh
RUN chmod a+x /usr/local/bin/docker_entrypoint.sh
ADD ./check-electrum.sh /usr/local/bin/check-electrum.sh
RUN chmod a+x /usr/local/bin/check-electrum.sh
ADD ./check-synced.sh /usr/local/bin/check-synced.sh
RUN chmod a+x /usr/local/bin/check-synced.sh
WORKDIR /data
# Electrum RPC
EXPOSE 50001
# Prometheus monitoring
EXPOSE 4224
STOPSIGNAL SIGINT
ENTRYPOINT ["docker_entrypoint.sh"]