-
Notifications
You must be signed in to change notification settings - Fork 80
/
Dockerfile
83 lines (68 loc) · 3.33 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
81
82
83
FROM node:18-slim as builder
ARG STANDALONE
RUN mkdir /opt/local && apt-get update && apt-get install -y --no-install-recommends git gpg dirmngr ca-certificates wget python3 python3-dev \
$([ -n "$STANDALONE" ] || echo "autoconf automake build-essential ca-certificates curl dirmngr gettext git gnupg libpq-dev libtool libsqlite3-dev libffi-dev protobuf-compiler python3-mako python3-pip python3-venv python3-setuptools wget net-tools zlib1g-dev libsodium-dev libgmp-dev")
ARG TESTRUNNER
# v23.05.2
ENV LIGHTNINGD_COMMIT=e512f918fcaef276163b185cd712b89335424afd
RUN [ -n "$STANDALONE" ] || \
(git clone https://github.com/ElementsProject/lightning.git /opt/lightningd \
&& cd /opt/lightningd \
&& git checkout $LIGHTNINGD_COMMIT \
&& DEVELOPER=$TESTRUNNER ./configure --prefix=./target \
&& make \
&& make install \
&& rm -r target/share \
&& mv -f target/* /opt/local/)
ENV BITCOIN_VERSION 0.21.0
ENV BITCOIN_FILENAME bitcoin-$BITCOIN_VERSION-x86_64-linux-gnu.tar.gz
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-$BITCOIN_VERSION/$BITCOIN_FILENAME
ENV BITCOIN_SHA256 da7766775e3f9c98d7a9145429f2be8297c2672fe5b118fd3dc2411fb48e0032
ENV BITCOIN_ASC_URL https://bitcoincore.org/bin/bitcoin-core-$BITCOIN_VERSION/SHA256SUMS.asc
ENV BITCOIN_PGP_KEY 01EA5486DE18A882D4C2684590C8019E36C2E964
RUN [ -n "$STANDALONE" ] || \
(mkdir /opt/bitcoin && cd /opt/bitcoin \
&& wget -qO "$BITCOIN_FILENAME" "$BITCOIN_URL" \
&& echo "$BITCOIN_SHA256 $BITCOIN_FILENAME" | sha256sum -c - \
&& gpg --keyserver keyserver.ubuntu.com --recv-keys "$BITCOIN_PGP_KEY" \
&& wget -qO bitcoin.asc "$BITCOIN_ASC_URL" \
&& gpg --verify bitcoin.asc \
&& cat bitcoin.asc | grep "$BITCOIN_FILENAME" | sha256sum -c - \
&& BD=bitcoin-$BITCOIN_VERSION/bin \
&& tar -xzvf "$BITCOIN_FILENAME" $BD/bitcoind $BD/bitcoin-cli --strip-components=1 \
&& mv bin/* /opt/local/bin/)
RUN wget -qO /usr/bin/tini "https://github.com/krallin/tini/releases/download/v0.19.0/tini-amd64" \
&& echo "93dcc18adc78c65a028a84799ecf8ad40c936fdfc5f2a57b1acda5a8117fa82c /usr/bin/tini" | sha256sum -c - \
&& chmod +x /usr/bin/tini
WORKDIR /opt/charged
COPY package.json npm-shrinkwrap.json ./
RUN npm install \
&& test -n "$TESTRUNNER" || { \
cp -r node_modules node_modules.dev \
&& npm prune --production \
&& mv -f node_modules node_modules.prod \
&& mv -f node_modules.dev node_modules; }
COPY . .
RUN npm run dist \
&& rm -rf src \
&& test -n "$TESTRUNNER" || (rm -rf test node_modules && mv -f node_modules.prod node_modules)
FROM node:18-slim
WORKDIR /opt/charged
ARG TESTRUNNER
ENV HOME /tmp
ENV NODE_ENV production
ARG STANDALONE
ENV STANDALONE=$STANDALONE
RUN apt-get update \
&& apt-get install -y --no-install-recommends inotify-tools \
&& ([ -n "$STANDALONE" ] || apt-get install -y --no-install-recommends libgmp-dev libsqlite3-dev libpq-dev) \
&& ([ -z "$TESTRUNNER" ] || apt-get install -y --no-install-recommends jq procps curl) \
&& rm -rf /var/lib/apt/lists/* \
&& ln -s /opt/charged/bin/charged /usr/bin/charged \
&& mkdir /data \
&& ln -s /data/lightning /tmp/.lightning
COPY --from=builder /opt/local /usr/local
COPY --from=builder /opt/charged /opt/charged
COPY --from=builder /usr/bin/tini /usr/bin/
ENTRYPOINT [ "tini", "-g", "--", "bin/docker-entrypoint.sh" ]
EXPOSE 9112 9735