Browse Source

Dockerfile changes and added supervisor

feature/dockerfile-arm
Gonzalo Javier Aune 5 years ago
parent
commit
9397890a4f
  1. 11
      .lnd/lnd.conf
  2. 30
      Dockerfile
  3. 2
      config/app.json
  4. 3
      lnd.conf.sample
  5. 6
      lnd_supervisor.conf
  6. 6
      relay_supervisor.conf
  7. 17
      supervisord.conf

11
.lnd/lnd.conf

@ -1,11 +0,0 @@
bitcoin.mainnet=1
bitcoin.active=1
bitcoin.node=neutrino
alias=myalias
listen=0.0.0.0:9735
rpclisten=0.0.0.0:10009
ignore-historical-gossip-filters=true
nobootstrap=true
numgraphsyncpeers=1

30
Dockerfile

@ -1,4 +1,5 @@
FROM golang:1.13-alpine as builder
LABEL maintainer="gonzaloaune@stakwork.com"
# Force Go to use the cgo based DNS resolver. This is required to ensure DNS
# queries required to connect to linked containers succeed.
@ -23,15 +24,19 @@ RUN git clone https://github.com/lightningnetwork/lnd /go/src/github.com/lightni
RUN cd /go/src/github.com/lightningnetwork/lnd \
&& git checkout $checkout \
&& make \
&& make install tags="signrpc walletrpc chainrpc invoicesrpc"
&& make install tags="signrpc walletrpc chainrpc invoicesrpc experimental"
# Start a new, final image.
FROM alpine as final
RUN mkdir /relay/
WORKDIR /relay/
EXPOSE 80
EXPOSE 9735/tcp
EXPOSE 9735/udp
EXPOSE 10009/tcp
EXPOSE 10009/udp
VOLUME /relay/.lnd
ENV NODE_ALIAS gonza-mayo
ENV NODE_ENV production
# Add bash and ca-certs, for quality of life and SSL-related reasons.
RUN apk --no-cache add \
@ -42,9 +47,12 @@ RUN apk --no-cache add \
COPY --from=builder /go/bin/lncli /bin/
COPY --from=builder /go/bin/lnd /bin/
RUN apk add --update nodejs nodejs-npm sqlite
RUN apk add --update nodejs nodejs-npm sqlite git supervisor
RUN git clone https://github.com/stakwork/sphinx-relay /relay/
WORKDIR /relay/
COPY package.json .
RUN npm install
RUN npm install nodemon --save-dev
RUN npm install express --save-dev
@ -56,5 +64,13 @@ RUN npm install --quiet node-gyp -g
RUN npm install sqlite3 --build-from-source --save-dev
RUN npm install --save-dev sequelize
RUN npm rebuild
COPY . .
RUN npm run tsc
RUN mkdir /relay/.lnd/
COPY ./lnd.conf.sample /relay/.lnd/lnd.conf
RUN mkdir -p /var/log/supervisor
COPY ./supervisord.conf /etc/supervisord.conf
COPY ./lnd_supervisor.conf /etc/supervisor.d/lnd_supervisor.ini
COPY ./relay_supervisor.conf /etc/supervisor.d/relay_supervisor.ini
CMD ["/usr/bin/supervisord"]

2
config/app.json

@ -15,7 +15,7 @@
"production": {
"macaroon_location": "/relay/.lnd/data/chain/bitcoin/mainnet/admin.macaroon",
"tls_location": "/relay/.lnd/tls.cert",
"node_ip": "172.22.0.2",
"node_ip": "localhost",
"lnd_port": "10009",
"node_http_protocol": "http",
"node_http_port": "3000",

3
lnd.conf.sample

@ -1,11 +1,12 @@
bitcoin.mainnet=1
bitcoin.active=1
bitcoin.node=neutrino
accept-keysend=1
alias=myalias
listen=0.0.0.0:9735
rpclisten=0.0.0.0:10009
ignore-historical-gossip-filters=true
nobootstrap=true
numgraphsyncpeers=1
routing.assumechanvalid=1

6
lnd_supervisor.conf

@ -0,0 +1,6 @@
[program:lnd]
user=root
command=lnd --lnddir=/relay/.lnd/
startretries=999999999999999999999999999
autostart=true
autorestart=true

6
relay_supervisor.conf

@ -0,0 +1,6 @@
[program:relay]
user=root
command=npm start --prefix /relay/
startretries=999999999999999999999999999
autostart=true
autorestart=true

17
supervisord.conf

@ -0,0 +1,17 @@
[unix_http_server]
file=/run/supervisord.sock ; (the path to the socket file)
[supervisord]
logfile=/var/log/supervisord.log ; (main log file;default $CWD/supervisord.log)
loglevel=info ; (log level;default info; others: debug,warn,trace)
nodaemon=true
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///run/supervisord.sock ; use a unix:// URL for a unix socket
[include]
files = /etc/supervisor.d/*.ini
Loading…
Cancel
Save