From d16f978c1e01806bfd8c738f95043c8bbe25aaed Mon Sep 17 00:00:00 2001 From: Gonzalo Javier Aune Date: Mon, 4 May 2020 14:20:37 +0100 Subject: [PATCH] Updates to config file for ECS --- Dockerfile | 9 ++++++--- init.sh | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 init.sh diff --git a/Dockerfile b/Dockerfile index 3a7ead0..f00c068 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,7 +35,6 @@ EXPOSE 9735/udp EXPOSE 10009/tcp EXPOSE 10009/udp -ENV NODE_ALIAS mynodealias ENV NODE_ENV production # Add bash and ca-certs, for quality of life and SSL-related reasons. @@ -50,16 +49,17 @@ COPY --from=builder /go/bin/lnd /bin/ RUN apk add --update nodejs nodejs-npm sqlite git supervisor RUN git clone https://github.com/stakwork/sphinx-relay /relay/ -RUN cd /relay && git checkout feature/docker WORKDIR /relay/ +RUN git checkout feature/docker + RUN npm install RUN npm install nodemon --save-dev RUN npm install express --save-dev RUN npm install webpack webpack-cli --save-dev -RUN apk --no-cache add g++ gcc libgcc libstdc++ linux-headers make python +RUN apk --no-cache add g++ gcc libgcc libstdc++ linux-headers make python jq git RUN npm install --quiet node-gyp -g RUN npm install sqlite3 --build-from-source --save-dev @@ -71,6 +71,9 @@ VOLUME /relay/.lnd COPY ./lnd.conf.sample /relay/.lnd/lnd.conf +COPY init.sh /etc/profile.d/ +RUN sudo chmod +x /etc/profile.d/init.sh + RUN mkdir -p /var/log/supervisor COPY ./supervisord.conf /etc/supervisord.conf COPY ./lnd_supervisor.conf /etc/supervisor.d/lnd_supervisor.ini diff --git a/init.sh b/init.sh new file mode 100644 index 0000000..d805250 --- /dev/null +++ b/init.sh @@ -0,0 +1,2 @@ +NODE_IP=$(curl http://169.254.170.2/v4/e52231f4-0246-4fc5-bc3e-ac20df1b118e | echo $(jq -r .DockerName).$NODE_DOMAIN) +NODE_ALIAS=$(curl http://169.254.170.2/v4/e52231f4-0246-4fc5-bc3e-ac20df1b118e | echo $(jq -r .DockerName)) \ No newline at end of file