forked from romanz/electrs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (28 loc) · 854 Bytes
/
Dockerfile
File metadata and controls
43 lines (28 loc) · 854 Bytes
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
FROM rust:1.44.1-slim-buster as builder
WORKDIR /build
RUN apt-get update \
&& apt-get install -y --no-install-recommends clang=1:7.* cmake=3.* \
libsnappy-dev=1.* \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY . .
RUN cargo install --locked --path .
# Create runtime image
FROM debian:buster-slim
WORKDIR /app
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN groupadd -r user \
&& adduser --disabled-login --system --shell /bin/false --uid 1000 --ingroup user user
COPY --from=builder --chown=user:user \
/build/target/release/electrs .
USER user
# Electrum RPC
EXPOSE 50001
# Prometheus monitoring
EXPOSE 4224
STOPSIGNAL SIGINT
HEALTHCHECK CMD curl -fSs http://localhost:4224/ || exit 1
ENTRYPOINT ["./electrs"]