From 4558691f4660f8547cdea03219ae7a511fd7ddfb Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Wed, 5 Dec 2018 16:28:04 -0400 Subject: [PATCH] Dockerfile for nvm, nodejs and embark installation --- .dockerignore | 4 ++++ Dockerfile | 27 +++++++++++++++++++++++++++ build.sh | 3 +++ 3 files changed, 34 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100755 build.sh diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6de4f67 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +node_modules +npm-debug.log +dist +.embark \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..35b2348 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM ubuntu:latest + +RUN apt-get update \ + && apt-get install -y curl git build-essential python \ + && apt-get -y autoclean + +RUN groupadd status + +RUN useradd -d /home/status -ms /bin/bash -g status -G sudo -p status status +USER status +WORKDIR /home/status + +ENV NVM_VERSION v0.33.11 +ENV NODE_VERSION v10.13.0 +ENV NVM_DIR /home/status/.nvm +RUN mkdir $NVM_DIR +RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash + +ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules +ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH + +RUN echo "source $NVM_DIR/nvm.sh && \ + nvm install $NODE_VERSION && \ + nvm alias default $NODE_VERSION && \ + nvm use default && \ + npm install -g node-gyp && \ + npm install -g embark" | bash \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..d63adfd --- /dev/null +++ b/build.sh @@ -0,0 +1,3 @@ +#!/bin/bash +docker build -t registration_dapp . +docker run -it registration_dapp bash \ No newline at end of file