1
0
mirror of https://github.com/romanz/electrs.git synced 2024-11-19 09:54:09 +01:00
electrs/Dockerfile
2021-03-21 00:51:51 +01:00

39 lines
792 B
Docker

FROM rust:1.44.1-slim-buster as builder
RUN apt-get update \
&& apt-get install -y --no-install-recommends clang=1:7.* cmake=3.* \
libsnappy-dev=1.* curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN adduser --disabled-login --system --shell /bin/false --uid 1000 user
WORKDIR /home/user
COPY . .
RUN chown -R user .
RUN cargo install --locked --path .
# Create runtime image
FROM debian:buster-slim
RUN adduser --disabled-login --system --shell /bin/false --uid 1000 user
WORKDIR /home/user/app
RUN chown user .
COPY --from=builder /home/user/target/release .
USER user
# Electrum RPC
EXPOSE 50001
# Prometheus monitoring
EXPOSE 4224
STOPSIGNAL SIGINT
HEALTHCHECK CMD curl -fSs http://localhost:4224/ || exit 1
ENTRYPOINT ["./electrs", "-vvvv", "--timestamp"]