Skip to content

Docker #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down