diff --git a/Dockerfile b/Dockerfile index 16710a4..d8e300a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,12 +14,6 @@ ARG checkout="v0.9.0-beta" # Install dependencies and build the binaries. RUN apk add --no-cache --update alpine-sdk git make gcc openssh-client -# RUN mkdir /root/.ssh/ -# ADD id_rsa /root/.ssh/id_rsa -# RUN touch /root/.ssh/known_hosts -# RUN ssh-keyscan github.com >> /root/.ssh/known_hosts -# RUN git clone git@github.com:stakwork/lnd-lean.git /go/src/github.com/lightningnetwork/lnd - 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 \ @@ -33,17 +27,16 @@ 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 +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 --update nodejs nodejs-npm sqlite git supervisor +RUN apk add --no-cache --update nodejs nodejs-npm sqlite git supervisor RUN git clone https://github.com/stakwork/sphinx-relay /relay/ diff --git a/package.json b/package.json index 4f619b3..a6c68cd 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "tsc": "rm -rf dist/ && tsc && cp -r public dist/public", "dev": "rm -rf dist/ && tsc && cp -r public dist/public && node --inspect ./dist/app.js", "build-binaries": "rm -rf dist/ && tsc && cp config/app.json dist/config/app.json && cp config/config.json dist/config/config.json && pkg . --target node12-alpine-x64,node12-macos-x64 --out-path binaries", - "start-ecs": "export NODE_ALIAS=$HOSTNAME && export NODE_IP=$(curl $ECS_CONTAINER_METADATA_URI | echo $(jq -r .DockerName).$NODE_DOMAIN):443 && export NODE_ENV=production && node --max-old-space-size=128 dist/app.js" + "start-ecs": "export NODE_ENV=production && node --max-old-space-size=128 dist/app.js" }, "keywords": [], "author": "", diff --git a/relay_supervisor.conf b/relay_supervisor.conf index d59f07b..c765433 100644 --- a/relay_supervisor.conf +++ b/relay_supervisor.conf @@ -1,6 +1,6 @@ [program:relay] user=root -command=npm run start-ecs --prefix /relay/ +command=sh -c 'export NODE_ALIAS=$HOSTNAME && export NODE_IP=$NODE_SCHEME://$(curl $ECS_CONTAINER_METADATA_URI | echo $(jq -r .DockerName).$NODE_DOMAIN) && npm run start-ecs --prefix /relay/' startretries=999999999999999999999999999 autostart=true autorestart=true