diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..70dac56 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM ubuntu:16.04 + +RUN apt-get update \ + && apt-get -y upgrade \ + && apt-get install -y git python-virtualenv python3-virtualenv curl ntp build-essential screen cmake pkg-config libboost-all-dev libevent-dev libunbound-dev libminiupnpc-dev libunwind8-dev liblzma-dev libldns-dev libexpat1-dev libgtest-dev libzmq3-dev + +RUN curl -fsSL https://deb.nodesource.com/setup_6.x -o /tmp/node_setup.sh \ + && bash /tmp/node_setup.sh \ + && rm /tmp/node_setup.sh \ + && apt-get install -y nodejs + +COPY . /app/ + +RUN cd /app/ \ + && npm install \ + && cp -n config_example.json config.json \ + && openssl req -subj "/C=IT/ST=Pool/L=Daemon/O=Mining Pool/CN=mining.proxy" -newkey rsa:2048 -nodes -keyout cert.key -x509 -out cert.pem -days 36500 + +EXPOSE 8080 8443 3333 + +WORKDIR /app/ +CMD ["node", "proxy.js"] diff --git a/README.md b/README.md index 5c48ddb..e2df26d 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,20 @@ or using the pm2 monitor pm2 monit ``` +Deployment via Docker +------------------------ + +1. Build the image + +``` +docker build . -t xmr-node-proxy +``` +2. Run the container, add custom config, expose some ports + +``` +docker run -v $PWD/config.json:/app/config.json -p 3333:3333 -p 8080:8080 -p 8443:8443 xmr-node-proxy +``` + Known Issues ============ VM's with 512Mb of ram or less will need some swap space in order to compile the C extensions for node. Bignum and the CN libraries can chew some serious memory during compile.