From 840f5ea1cb4cd30ed43933e5c365d57a6f8265db Mon Sep 17 00:00:00 2001 From: rllola Date: Mon, 9 Oct 2017 11:28:02 +0200 Subject: [PATCH 1/2] Add Dockerfile --- .dockerignore | 9 +++++++++ .gitignore | 2 ++ Dockerfile | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..a778ff7 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,9 @@ +build/ +build-cmakejs/ +conan_imports_manifest.txt +conanfile.pyc +conaninfo* +conanbuildinfo* +node_modules/ +dist/ +joystream.log diff --git a/.gitignore b/.gitignore index dc89152..9a56a83 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ conanbuildinfo* node_modules/ dist/ joystream.log +id_rsa +id_rsa.pub diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d89fccd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,39 @@ +FROM ubuntu:16.04 + +MAINTAINER Lola Rigaut-Luczak + +WORKDIR /usr/src/app + +RUN apt-get update + +RUN apt-get -y install g++ cmake git python-pip python-dev curl + +RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - + +RUN apt-get -y install nodejs build-essential + +# Make ssh dir +RUN mkdir /root/.ssh/ +# Copy over private key, and set permissions +ADD id_rsa /root/.ssh/id_rsa +# Create known_hosts +RUN touch /root/.ssh/known_hosts +# Add bitbuckets key +RUN ssh-keyscan github.com >> /root/.ssh/known_hosts + +RUN pip install --upgrade pip +RUN pip install conan +RUN conan remote add joystream https://conan.joystream.co:9300 True +RUN conan user travis -p trav444 -r=joystream + +COPY . . + +RUN npm install -g node-gyp + +RUN npm install +RUN npm run transpile +RUN node-gyp rebuild + +EXPOSE 6881 + +CMD [ "npm", "run", "purchase" ] From 6adae4ef766986d746d27c7028ec8f7215932765 Mon Sep 17 00:00:00 2001 From: rllola Date: Mon, 9 Oct 2017 11:32:29 +0200 Subject: [PATCH 2/2] Update README --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 4a65107..5e51af6 100644 --- a/README.md +++ b/README.md @@ -21,3 +21,20 @@ building for electron for example: ``` $ node-gyp rebuild --target=1.6.2 --arch=x64 --dist-url=https://atom.io/download/electron ``` + +## Docker + +You will need to generate a ssh key and to add it to your github in order to be able to pull the dependencies libraries with conan. +Docker will look for a `id_rsa` file to copy in the container. + +Build : +``` +docker build -t joystream-node . +``` + +Run container : +``` +docker run -d --name joystream-node joystream-node +``` + +Notes: You might need a server with 4GB ram so it can build.