forked from stakwork/sphinx-relay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.lndrelay
92 lines (64 loc) · 2.75 KB
/
Dockerfile.lndrelay
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
84
85
86
87
88
89
90
91
92
FROM golang:1.13-alpine as builder
LABEL maintainer="[email protected]"
# Force Go to use the cgo based DNS resolver. This is required to ensure DNS
# queries required to connect to linked containers succeed.
ENV GODEBUG netdns=cgo
# Pass a tag, branch or a commit using build-arg. This allows a docker
# image to be built from a specified Git state. The default image
# will use the Git tip of master by default.
ARG checkout="v0.11.1-beta"
# ARG checkout="master"
# Install dependencies and build the binaries.
RUN apk add --no-cache --update alpine-sdk git make gcc openssh-client
RUN git clone https://github.com/lightningnetwork/lnd /go/src/github.com/lightningnetwork/lnd
RUN cd /go/src/github.com/lightningnetwork/lnd \
&& git checkout $checkout \
&& make \
&& make install tags="signrpc walletrpc chainrpc invoicesrpc experimental"
# Start a new, final image.
FROM alpine:3.11 as final
EXPOSE 80
EXPOSE 9735
ENV NODE_ENV production
ENV NODE_SCHEME http
# Add bash and ca-certs, for quality of life and SSL-related reasons.
RUN apk --no-cache add bash ca-certificates
# Copy the binaries from the builder image.
COPY --from=builder /go/bin/lncli /bin/
COPY --from=builder /go/bin/lnd /bin/
RUN apk add --no-cache --update nodejs=12.22.6-r0 nodejs-npm=12.22.6-r0 sqlite=3.30.1-r2 git supervisor
RUN git clone https://github.com/stakwork/sphinx-relay /relay/
WORKDIR /relay/
ARG sphinx_checkout="master"
RUN git checkout $sphinx_checkout
RUN apk --no-cache add g++ gcc libgcc libstdc++ linux-headers make python jq git curl libmcrypt-dev
USER root
RUN rm -rf node_modules/
RUN npm install
RUN npm install --quiet [email protected] -g
RUN npm -g config set user root
RUN npm install nw-gyp -g
RUN npm uninstall sqlite3
RUN npm install sqlite3 --build-from-source --runtime=node-webkit --target_arch=x64 --target=0.42.0
RUN npm uninstall sqlite3
RUN npm install sqlite3 --build-from-source --runtime=node-webkit --target_arch=x64 --target=0.42.0
RUN npm rebuild
RUN npm run tsc
VOLUME /relay/.lnd
COPY ./docker/lnd.conf.sample /relay/.lnd/lnd.conf
#Uncomment if you have a copy of the channel.db you want to use.
#COPY ./channel.db /relay/.lnd/data/graph/mainnet/
RUN git clone https://github.com/stakwork/sphinx-keysend-test/ /sphinx-keysend/
WORKDIR /sphinx-keysend/
ARG sphinx_keysend_checkout="binary"
RUN git checkout $sphinx_keysend_checkout
RUN npm install
WORKDIR /relay/
RUN apk --no-cache add expect bash
RUN mkdir -p /var/log/supervisor
COPY ./docker/supervisord.conf /etc/supervisord.conf
COPY ./docker/lnd_supervisor.conf /etc/supervisor.d/lnd_supervisor.ini
COPY ./docker/relay_supervisor.conf /etc/supervisor.d/relay_supervisor.ini
COPY ./docker/aliases.sh /etc/profile.d/aliases.sh
ENV ENV="/etc/profile"
ENTRYPOINT [ "bash", "/relay/docker/entrypoint.sh" ]