FROM node:8.9-slim as builder ARG STANDALONE=1 RUN apt-get update && apt-get install -y --no-install-recommends git \ $([ -n "$STANDALONE" ] || echo "autoconf automake build-essential libtool libgmp-dev \ libsqlite3-dev python python3 wget zlib1g-dev") ARG TESTRUNNER ARG LIGHTNINGD_VERSION=master RUN [ -n "$STANDALONE" ] || \ (git clone https://github.com/groestlcoin/lightning.git /opt/lightningd \ && cd /opt/lightningd \ && git checkout $LIGHTNINGD_VERSION \ && DEVELOPER=$TESTRUNNER ./configure \ && make) ENV GROESTLCOIN_VERSION 2.16.3 ENV GROESTLCOIN_URL https://github.com/Groestlcoin/groestlcoin/releases/download/v2.16.3/groestlcoin-2.16.3-x86_64-linux-gnu.tar.gz ENV GROESTLCOIN_SHA256 f15bd5e38b25a103821f1563cd0e1b2cf7146ec9f9835493a30bd57313d3b86f RUN [ -n "$STANDALONE" ] || \ (mkdir /opt/groestlcoin && cd /opt/groestlcoin \ && wget -qO groestlcoin.tar.gz "$GROESTLCOIN_URL" \ && echo "$GROESTLCOIN_SHA256 groestlcoin.tar.gz" | sha256sum -c - \ && tar -xzvf groestlcoin.tar.gz groestlcoin-cli --exclude=*-qt) RUN mkdir /opt/bin && ([ -n "$STANDALONE" ] || \ (mv /opt/lightningd/cli/lightning-cli /opt/bin/ \ && mv /opt/lightningd/lightningd/lightning* /opt/bin/ \ && mv /opt/groestlcoin/bin/* /opt/bin/)) 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:8.9-slim WORKDIR /opt/charged ARG TESTRUNNER ENV HOME /tmp ENV NODE_ENV production ARG STANDALONE ENV STANDALONE=$STANDALONE RUN ([ -n "$STANDALONE" ] || ( \ apt-get update && apt-get install -y --no-install-recommends inotify-tools libgmp-dev libsqlite3-dev \ $(test -n "$TESTRUNNER" && echo jq))) \ && 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/bin /usr/bin COPY --from=builder /opt/charged /opt/charged CMD [ "bin/docker-entrypoint.sh" ] EXPOSE 9112 9735