Browse Source

Dockerize

pull/1/head
webworker01 3 years ago
parent
commit
6117438822
  1. 1
      .dockerignore
  2. 2
      .gitignore
  3. 24
      Dockerfile
  4. 32
      README.md
  5. 8
      coins/komodo.json
  6. 31
      docker-compose.yml
  7. 5
      libs/website.js
  8. 1855
      package-lock.json
  9. 2
      package.json

1
.dockerignore

@ -0,0 +1 @@
redis-data

2
.gitignore

@ -4,4 +4,6 @@ config.json
pool_configs/
!pool_configs/zclassic_example.json
coins/
!coins/komodo.json
website/piratepool.io/static/*.txt
redis-data/

24
Dockerfile

@ -0,0 +1,24 @@
FROM ubuntu:18.04
LABEL maintainer="webworker01"
RUN apt-get update -y && \
apt-get install -y gcc g++ make libboost-dev libboost-system-dev libsodium-dev sudo curl git iputils-ping
RUN curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - && \
apt-get install -y nodejs
RUN useradd knomp
COPY . /home/knomp/knomp
RUN echo "knomp ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/user && \
chmod 0440 /etc/sudoers.d/user && \
chown -R knomp:knomp /home/knomp
RUN cd /home/knomp/knomp && npm install
USER knomp
WORKDIR /home/knomp/knomp
EXPOSE 8080
CMD npm start

32
README.md

@ -12,6 +12,38 @@ Differences between this and Z-NOMP
* This is meant for Komodo mining
* Founders, Treasury, and other ZEC/ZEN specific stuff is removed
Using Docker (easy)
-------------
[Install Docker](https://docs.docker.com/engine/install/)
To install (
```
git clone https://github.com/webworker01/knomp.git
cd ./knomp
cp config_example.json config.json
```
Setup your (config.json)[config_example.json], `./coins/` and `./pool_configs/` in here, then:
```
docker-compose up &
```
To stop:
```
docker-compose down
```
To rebuild:
```
docker-compose down
docker rmi knomp_knomp
git pull
docker-compose up &
```
Upgrade
-------------
Please be sure to backup your `./coins` and `./pool_configs` directory before upgrading

8
coins/komodo.json

@ -0,0 +1,8 @@
{
"name": "komodo",
"symbol": "kmd",
"algorithm": "equihash",
"txfee": 0.00005,
"peerMagic": "f9eee48d",
"sapling": true
}

31
docker-compose.yml

@ -0,0 +1,31 @@
version: '3'
services:
knomp:
container_name: knomp
network_mode: host
build:
context: .
dockerfile: Dockerfile
volumes:
- ./config.json:/home/knomp/knomp/config.json
- ./coins:/home/knomp/knomp/coins
- ./libs:/home/knomp/knomp/libs
- ./pool_configs:/home/knomp/knomp/pool_configs
- ./website:/home/knomp/knomp/website
ports:
- 8080:8080
- 3333:3333
depends_on:
- redis
redis:
image: redis:6.0.10-alpine
container_name: redis
network_mode: host
command: ["redis-server", "--appendonly", "yes"]
volumes:
- ./redis-data:/data
ports:
- 6379:6379
restart: always

5
libs/website.js

@ -209,6 +209,11 @@ module.exports = function(logger){
var app = express();
app.use('/robots.txt', function (req, res, next) {
res.type('text/plain')
res.send("User-agent: *\nDisallow: /workers/*");
});
app.use(bodyParser.json());
app.get('/get_page', function(req, res, next){

1855
package-lock.json

File diff suppressed because it is too large

2
package.json

@ -45,7 +45,7 @@
"nonce": "1.0.4",
"redis": "2.8.0",
"request": "^2.88.0",
"stratum-pool": "git+https://github.com/webworker01/node-stratum-pool.git#new-merkle"
"stratum-pool": "git+https://github.com/webworker01/node-stratum-pool.git"
},
"engines": {
"node": ">=8.11"

Loading…
Cancel
Save