diff --git a/Dockerfile b/Dockerfile index 6f228af..a3742aa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,20 @@ -FROM ubuntu:trusty - -WORKDIR /tmp +FROM ubuntu:bionic RUN apt-get update && \ - apt-get install -y supervisor wget unzip && \ - wget -O dogecoin.tgz https://github.com/dogecoin/dogecoin/releases/download/v1.10.0-dogeparty/dogecoin-1.10.0-linux64.tar.gz && \ - tar zxvf dogecoin.tgz dogecoin-1.10.0/bin/dogecoind --strip-components=2 && \ - mv dogecoind /usr/local/bin/dogecoind && \ - chmod +x /usr/local/bin/dogecoind && \ + apt-get install -y wget sudo && \ + rm -rf /var/lib/apt/lists/* + +RUN cd /tmp && \ + wget -qO dogecoin.tgz https://github.com/dogecoin/dogecoin/releases/download/v1.14-rc-1/dogecoin-1.14.0-x86_64-linux-gnu.tar.gz && \ + tar zxvf dogecoin.tgz --strip-components=1 -C / && \ useradd -m crypto && \ su -c "mkdir /home/crypto/dogecoin/" crypto && \ - rm -rf /tmp/dogecoin.zip /var/lib/apt/lists/* + rm -vf dogecoin.tgz ADD dogecoin.conf /home/crypto/dogecoin.conf -ADD supervisor-dogecoin.conf /etc/supervisor/conf.d/dogecoin.conf +ADD start /start VOLUME /home/crypto/dogecoin/ EXPOSE 6969 22556 -CMD supervisord +ENTRYPOINT ["/start"] diff --git a/start b/start new file mode 100755 index 0000000..b3fcda8 --- /dev/null +++ b/start @@ -0,0 +1,12 @@ +#!/bin/bash + +CONFPATH=/home/crypto/dogecoin.conf +RPCUSER=${RPCUSER:-bobby} +RPCPASS=${RPCPASS:-propane} + +sed -i -E "s/rpcuser=.+$/rpcuser=$RPCUSER/" $CONFPATH +sed -i -E "s/rpcpassword=.+$/rpcpassword=$RPCPASS/" $CONFPATH + +chown -R crypto:crypto /home/crypto/dogecoin/ + +exec sudo -Hu crypto dogecoind -conf=$CONFPATH diff --git a/supervisor-dogecoin.conf b/supervisor-dogecoin.conf deleted file mode 100644 index ed8970d..0000000 --- a/supervisor-dogecoin.conf +++ /dev/null @@ -1,6 +0,0 @@ -[supervisord] -nodaemon=true - -[program:dogecoind] -command=su -c "dogecoind -conf=/home/crypto/dogecoin.conf" crypto -autorestart=true