Browse Source

supervisord implemented

master^2
deacix 8 years ago
parent
commit
bd94152cdd
  1. 1
      .gitignore
  2. 31
      docker/Dockerfile
  3. 36
      docker/Dockerfile~
  4. 6
      docker/docker-compose.yml
  5. 25
      docker/settings.json
  6. 19
      docker/supervisord.conf
  7. 3
      docker/twister.conf

1
.gitignore vendored

@ -1,2 +1,3 @@
/build-buffer /build-buffer
node_modules node_modules
.idea

31
docker/Dockerfile

@ -4,33 +4,42 @@
FROM ubuntu:14.04 FROM ubuntu:14.04
# Install twister-core WORKDIR /opt
USER root
RUN apt-get update RUN apt-get update
RUN apt-get install -y git autoconf libtool build-essential libboost-all-dev libssl-dev libdb++-dev libminiupnpc-dev && apt-get clean RUN apt-get install -y git autoconf libtool build-essential libboost-all-dev libssl-dev libdb++-dev libminiupnpc-dev \
supervisor nodejs nodejs-legacy npm && \
apt-get clean
RUN git clone https://github.com/miguelfreitas/twister-core.git RUN git clone https://github.com/miguelfreitas/twister-core.git
RUN cd twister-core && \ RUN cd twister-core && \
./bootstrap.sh && \ ./bootstrap.sh && \
make make
RUN mkdir ~/.twister
RUN echo -e "rpcuser=user\nrpcpassword=pwd\nhtmldir=~/twister-react" > ~/.twister/twister.conf
RUN chmod 600 ~/.twister/twister.conf
RUN git clone https://github.com/Tschaul/twister-react.git RUN git clone https://github.com/Tschaul/twister-react.git
RUN git clone https://github.com/Tschaul/twister-lib-js.git RUN git clone https://github.com/Tschaul/twister-lib-js.git
RUN git clone https://github.com/digital-dreamer/twister-proxy.git RUN git clone https://github.com/digital-dreamer/twister-proxy.git
RUN apt-get install -y nodejs nodejs-legacy npm
RUN npm install -g browserify react-tools RUN npm install -g browserify react-tools
RUN cd twister-lib-js \ npm install RUN cd twister-lib-js \ npm install
RUN cd twister-react \ npm install \ npm run pull-lib-and-build RUN cd twister-proxy && npm install
RUN cd twister-proxy \ npm install RUN mv twister-react/index.html twister-react/home.html
COPY settings.json twister-proxy/ COPY settings.json twister-proxy/
CMD cd twister-core \ ./twisterd & \ cd ../twister-proxy \ node twister-proxy.js & RUN mkdir -p /root/.twister
COPY twister.conf /root/.twister/twister.conf
RUN chmod 600 /root/.twister/twister.conf
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
VOLUME ["/root/.twister"]
CMD ["/usr/bin/supervisord"]
ENTRYPOINT []
EXPOSE 80

36
docker/Dockerfile~

@ -1,36 +0,0 @@
#
# Dockerfile for building Twister peer-to-peer micro-blogging
#
FROM ubuntu:14.04
# Install twister-core
RUN apt-get update
RUN apt-get install -y git autoconf libtool build-essential libboost-all-dev libssl-dev libdb++-dev libminiupnpc-dev && apt-get clean
RUN git clone https://github.com/miguelfreitas/twister-core.git
RUN cd twister-core && \
./bootstrap.sh && \
make
RUN mkdir ~/.twister
RUN echo -e "rpcuser=user\nrpcpassword=pwd\nhtmldir=~/twister-react" > ~/.twister/twister.conf
RUN chmod 600 ~/.twister/twister.conf
RUN git clone https://github.com/Tschaul/twister-react.git
RUN git clone https://github.com/Tschaul/twister-lib-js.git
RUN git clone https://github.com/digital-dreamer/twister-proxy.git
RUN apt-get install -y nodejs nodejs-legacy npm
RUN npm install -g browserify react-tools
RUN cd twister-lib-js \ npm install
RUN cd twister-react \ npm install \ npm run pull-lib-and-build
RUN cd twister-proxy \ npm install
COPY settings.json twister-proxy/

6
docker/docker-compose.yml

@ -0,0 +1,6 @@
version: "2"
services:
twister:
build: .
ports:
- 80

25
docker/settings.json

@ -1,26 +1,19 @@
{ {
"Server": "Server": {
{ "ssl_key_file": "insert/path/to/your/server-key-file",
"ssl_key_file": "/etc/letsencrypt/live/example.com/privkey.pem", "ssl_certificate_file": "insert/path/to/your/ssl-certificate",
"ssl_certificate_file": "/etc/letsencrypt/live/example.com/cert.pem", "enable_https": false,
"ssl_chain_file": "/etc/letsencrypt/live/example.com/chain.pem",
"ssl_fullchain_file": "/etc/letsencrypt/live/example.com/fullchain.pem",
"enable_https": true,
"https_port": 443, "https_port": 443,
"http_port": 0 "http_port": 80
}, },
"RPC": {
"RPC":
{
"host": "localhost", "host": "localhost",
"port": 28332, "port": 28332,
"user": "user", "user": "user",
"password": "pwd" "password": "pwd"
}, },
"CallLimits": [
"CallLimits":
[
{ {
"name": "getbestblockhash", "name": "getbestblockhash",
"maxPerMinute": null, "maxPerMinute": null,
@ -367,9 +360,7 @@
"maxPerMinutePerIP": null "maxPerMinutePerIP": null
} }
], ],
"LogAsAttackThreshold": {
"LogAsAttackThreshold":
{
"callsOverLimits": 30, "callsOverLimits": 30,
"invalidRequests": 30, "invalidRequests": 30,
"forbiddenCalls": 30 "forbiddenCalls": 30

19
docker/supervisord.conf

@ -0,0 +1,19 @@
[supervisord]
nodaemon=true
[program:twisterd]
command=/opt/twister-core/twisterd
user=root
redirect_stderr=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
priority=1
[program:twister-proxy]
command=node twister-proxy.js
user=root
directory=/opt/twister-proxy
redirect_stderr=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
priority=2

3
docker/twister.conf

@ -0,0 +1,3 @@
rpcuser=user
rpcpassword=pwd
htmldir=/opt/twister-react
Loading…
Cancel
Save