diff --git a/Dockerfile b/Dockerfile index 1aa367e5..bac3e2f6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,64 @@ -# This will build the witness_node in a docker image. Make sure you've already -# checked out the submodules before building. +FROM phusion/baseimage:0.9.19 +MAINTAINER PeerPlays Blockchain Standards Association -FROM l3iggs/archlinux:latest -MAINTAINER Nathan Hourt +ENV LANG=en_US.UTF-8 +RUN \ + apt-get update -y && \ + apt-get install -y \ + g++ \ + autoconf \ + cmake \ + git \ + libbz2-dev \ + libreadline-dev \ + libboost-all-dev \ + libcurl4-openssl-dev \ + libssl-dev \ + libncurses-dev \ + doxygen \ + libcurl4-openssl-dev \ + && \ + apt-get update -y && \ + apt-get install -y fish && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* -RUN pacman -Syu --noconfirm gcc make autoconf automake cmake ninja boost libtool git +ADD . /peerplays-core +WORKDIR /peerplays-core -ADD . /bitshares-2 -WORKDIR /bitshares-2 -RUN cmake -G Ninja -DCMAKE_BUILD_TYPE=Release . -RUN ninja witness_node || ninja -j 1 witness_node +# Compile +RUN \ + git submodule update --init --recursive && \ + cmake \ + -DCMAKE_BUILD_TYPE=Release \ + . && \ + make witness_node && \ + make install && \ + # + # Obtain version + mkdir /etc/peerplays && \ + git rev-parse --short HEAD > /etc/peerplays/version && \ + cd / && \ + rm -rf /peerplays-core -RUN mkdir /data_dir -ADD docker/default_config.ini /default_config.ini -ADD docker/launch /launch -RUN chmod a+x /launch -VOLUME /data_dir +# Home directory $HOME +WORKDIR / +RUN useradd -s /bin/bash -m -d /var/lib/peerplays peerplays +ENV HOME /var/lib/peerplays +RUN chown peerplays:peerplays -R /var/lib/peerplays -EXPOSE 8090 9090 +# Volume +VOLUME ["/var/lib/peerplays", "/etc/peerplays"] -ENTRYPOINT ["/launch"] +# rpc service: +EXPOSE 8090 +# p2p service: +EXPOSE 2001 + +# default exec/config files +ADD docker/default_config.ini /etc/peerplays/config.ini +ADD docker/peerplaysentry.sh /usr/local/bin/peerplaysentry.sh +RUN chmod a+x /usr/local/bin/peerplaysentry.sh + +# default execute entry +CMD /usr/local/bin/peerplaysentry.sh diff --git a/docker/default_config.ini b/docker/default_config.ini index 160a1484..fc7c2d20 100644 --- a/docker/default_config.ini +++ b/docker/default_config.ini @@ -47,28 +47,15 @@ required-participation = false # track-account = # Track market history by grouping orders into buckets of equal size measured in seconds specified as a JSON array of numbers -bucket-size = [15,60,300,3600,86400] +# bucket-size = [15,60,300,3600,86400] +bucket-size = [60,300,900,1800,3600,14400,86400] +# for 1 min, 5 mins, 30 mins, 1h, 4 hs and 1 day. i think this should be the default. # How far back in time to track history for each bucket size, measured in the number of buckets (default: 1000) history-per-size = 1000 -# declare an appender named "stderr" that writes messages to the console -[log.console_appender.stderr] -stream=std_error - -# declare an appender named "p2p" that writes messages to p2p.log -[log.file_appender.p2p] -filename=logs/p2p/p2p.log -# filename can be absolute or relative to this config file - -# route any messages logged to the default logger to the "stderr" logger we -# declared above, if they are info level are higher -[logger.default] -level=info -appenders=stderr - -# route messages sent to the "p2p" logger to the p2p appender declared above -[logger.p2p] -level=info -appenders=p2p +# Max amount of operations to store in the database, per account (drastically reduces RAM requirements) +max-ops-per-account = 1000 +# Remove old operation history # objects from RAM +partial-operations = true diff --git a/docker/launch b/docker/launch deleted file mode 100644 index 69373413..00000000 --- a/docker/launch +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -[ -e /data_dir/config.ini ] || cp /default_config.ini /data_dir/config.ini - -[ -e /data_dir/pre_exec ] && bash /data_dir/pre_exec -if [ -e /data_dir/extra_args ]; then - /bitshares-2/programs/witness_node/witness_node --data-dir /data_dir `cat /data_dir/extra_args` -else - /bitshares-2/programs/witness_node/witness_node --data-dir /data_dir -fi -[ -e /data_dir/post_exec ] && bash /data_dir/post_exec