Dockerfile for nvm, nodejs and embark installation

This commit is contained in:
Richard Ramos 2018-12-05 16:28:04 -04:00
parent 544706c972
commit 4558691f46
3 changed files with 34 additions and 0 deletions

4
.dockerignore Normal file
View File

@ -0,0 +1,4 @@
node_modules
npm-debug.log
dist
.embark

27
Dockerfile Normal file
View File

@ -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

3
build.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
docker build -t registration_dapp .
docker run -it registration_dapp bash