Add initial docker support (#8)

I use docker for everything so this commit adds initial docker support
to allow me to test changes to the code quickly.
This commit is contained in:
Beshoy Girgis 2018-07-19 20:29:34 -05:00 committed by GitHub
parent 67fab6fa5b
commit 0155dc1daf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 2006 additions and 1 deletions

13
Dockerfile Normal file
View File

@ -0,0 +1,13 @@
FROM keymetrics/pm2:8-stretch
RUN apt-get -yqq update && \
apt-get -yqq upgrade && \
apt-get -yqq install libboost-all-dev libsodium-dev
RUN apt-get -yqq install vim git zsh tmux silversearcher-ag && \
curl -Lo- http://bit.ly/2pztvLf | bash
ENV SHELL /bin/zsh
ENV NPM_CONFIG_LOGLEVEL warn
CMD ["pm2-runtime", "start", "ecosystem.config.js", "--only", "site"]

24
docker-compose.yml Normal file
View File

@ -0,0 +1,24 @@
version: '3'
services:
site:
build:
context: .
working_dir: /site
ports:
- 80
volumes:
- ./:/site
- ../.zsh_history:/root/.zsh_history
ulimits:
nofile:
soft: 999999
hard: 999999
command: ["pm2-runtime", "start", "ecosystem.config.js", "--only", "site"]
redis:
image: redis:latest
volumes:
- ../.redis:/data
# vim:set ts=2 sw=2 smarttab:

15
ecosystem.config.js Normal file
View File

@ -0,0 +1,15 @@
module.exports = {
/**
* Application configuration section
* http://pm2.keymetrics.io/docs/usage/application-declaration/
*/
apps: [{
name: 'site',
script: 'init.js',
node_args: '--max_old_space_size=2048',
max_memory_restart : "4G",
env_production: {
NODE_ENV: 'production'
}
}]
}

1953
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -51,7 +51,7 @@
"stratum-pool": "git+https://github.com/z-nomp/node-stratum-pool.git"
},
"engines": {
"node": ">=0.10"
"node": ">=8.11"
},
"scripts": {
"start": "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/node_modules/stratum-pool/node_modules/equihashverify/build/Release/:$PWD/node_modules/equihashverify/build/Release/ node init.js"