-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
80 lines (60 loc) · 1.52 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
FROM alpine:3.19 AS build
ARG BITCOIND_VERSION="master"
WORKDIR /app
RUN apk update && apk add --no-cache \
alpine-sdk \
autoconf \
automake \
boost-dev \
libevent-dev \
libressl \
libtool \
sqlite-dev \
zeromq-dev
RUN git clone --depth 1 --branch $BITCOIND_VERSION https://github.com/bitcoin/bitcoin
RUN cd bitcoin && \
./autogen.sh && \
./configure \
--prefix=/app/bitcoin \
--disable-bench \
--disable-ccache \
--disable-tests \
--with-gui=no \
--with-sqlite=yes && \
make -j4 && \
make install && \
strip /app/bitcoin/bin/*
FROM alpine:3.19
ARG UID="1001"
ARG GID="1001"
ENV DB_CACHE="450"
ENV MAX_MEM_POOL="300"
ENV MAX_ORPHAN_TX="100"
ENV PRUNE="0"
ENV MAX_CONNECTIONS="125"
ENV MAX_UPLOAD_TARGET="0"
ENV CHAIN="main"
ENV RPC_ALLOW_IP=""
ENV RPC_BIND="127.0.0.1"
ENV RPC_PASSWORD=""
ENV RPC_USER=""
ENV RPC_ENABLED="0"
WORKDIR /app
RUN apk update && apk add --no-cache \
gettext \
libevent \
libzmq \
sqlite-dev
RUN addgroup -g $GID bitcoind && adduser -u $UID -G bitcoind -D bitcoind
RUN mkdir /app/config && \
mkdir /app/data && \
chown bitcoind:bitcoind /app/config && \
chown bitcoind:bitcoind /app/data
COPY --from=build /app/bitcoin/bin /usr/local/bin
COPY --chown=bitcoind:bitcoind config/bitcoin.conf /app/config
COPY docker-entrypoint.sh /docker-entrypoint.sh
EXPOSE 8332 8333
VOLUME /app/data
USER bitcoind
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["bitcoind", "-conf=/app/config/bitcoin.conf", "-datadir=/app/data"]