diff --git a/Dockerfile b/Dockerfile index ec8c2fb..8dcb666 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,29 +1,43 @@ -# getting base image ubuntu +# Getting base image ubuntu FROM python:3.9.0-slim ENV DEBIAN_FRONTEND=noninteractive +SHELL ["/bin/bash", "-c"] MAINTAINER shivam -CMD {"echo","Ranchi Mall"} +CMD { "echo", "Ranchi Mall" } FROM ubuntu:latest -RUN apt-get update -RUN apt-get -y install python3-pip -RUN pip install --upgrade pip -RUN apt-get install -RUN apt-get -y install git - ## for apt to be noninteractive ENV DEBIAN_FRONTEND noninteractive ENV DEBCONF_NONINTERACTIVE_SEEN true -# Flo Token Tracker +RUN apt-get update +RUN apt-get -y install python3-pip +RUN apt-get -y install git +RUN apt-get -y install python-chardet python3.9 python3.9-venv +RUN apt-get -y install libsecp256k1-dev libssl-dev build-essential automake pkg-config libtool libffi-dev libgmp-dev libyaml-cpp-dev +RUN apt-get install supervisor + + +# Installation of Pybtc, currently named as Pyflo +WORKDIR ../ +RUN git clone https://github.com/ranchimall/pyflo +WORKDIR pyflo +RUN apt-get install -y pkg-config +RUN python3 setup.py install + +# Setup of Flo Token Tracker RUN git clone https://github.com/vivekteega/ftt-docker WORKDIR ftt-docker +#RUN python3.9 -m venv ftt +#RUN . ftt/bin/activate +RUN pip3 install chardet +RUN pip3 install arrow +RUN pip3 install socketio +RUN pip3 install requests RUN sed -i "s|chardet==4.0.0|chardet|g" /ftt-docker/requirements.txt -# RUN pip3 install -r requirements.txt - RUN touch config.ini RUN echo "[DEFAULT] \n\ NET = testnet \n\ @@ -31,38 +45,29 @@ FLO_CLI_PATH = /usr/local/bin/flo-cli \n\ START_BLOCK = 740400" >> /ftt-docker/config.ini RUN touch config.py -RUN echo "committeeAddressList = ['''''''''] \n\ +RUN echo "committeeAddressList = ['oVwmQnQGtXjRpP7dxJeiRGd5azCrJiB6Ka'] \n\ sseAPI_url = 'https://ranchimallflo-testnet.duckdns.org/' \n\ -privKey = ''''''' " >> /ftt-docker/config.py +privKey = 'RG6Dni1fLqeT2TEFbe7RB9tuw53bDPDXp8L4KuvmYkd5JGBam6KJ' " >> /ftt-docker/config.py -# Ranchimallflo API -WORKDIR ../ -RUN git clone https://github.com/ranchimall/pyflo -WORKDIR pyflo -#RUN python3 setup.py install -WORKDIR ../ -#Run python3 tracktokens-smartcontracts.py -#RUN apt-get -y install python-chardet -RUN apt-get -y install libsecp256k1-dev -RUN apt-get -y install libssl-dev build-essential automake pkg-config libtool libffi-dev libgmp-dev libyaml-cpp-dev +# Setup of RanchimallFlo API RUN git clone https://github.com/ranchimall/ranchimallflo-api WORKDIR ranchimallflo-api - -#RUN pip3 install -r requirements.txt -#RUN pip3 install apscheduler +RUN pip3 install -r requirements.txt +RUN pip3 install apscheduler RUN touch config.py -#RUN echo "dbfolder = '/home/production/dev/shivam/ranchimallflo-api' \n\ -#sse_pubKey = '''''''' \n\ -#apiUrl = 'https://flosight.duckdns.org/api/' \n\ -#apilayerAccesskey = ''''''' \n\ -#FLO_DATA_DIR = '/home/production/.flo' " >> /ranchimallflo-api/config.py -#RUN python3 ranchimallflo_api.py +RUN echo "dbfolder = '/home/production/dev/shivam/ranchimallflo-api' \n\ +sse_pubKey = '02b68a7ba52a499b4cb664033f511a14b0b8b83cd3b2ffcc7c763ceb9e85caabcf' \n\ +apiUrl = 'https://flosight.duckdns.org/api/' \n\ +apilayerAccesskey = '3abc51aa522420e4e185ac22733b0f30' \n\ +FLO_DATA_DIR = '/home/production/.flo' " >> /ranchimallflo-api/config.py + + +# Setup of Floscout -# Floscout # Supervisor configurations -RUN apt-get install supervisor +## Ranchimallflo configuration WORKDIR /etc/supervisor/conf.d/ RUN touch ranchimallflo-api.conf RUN echo "[program:ranchimallflo-api]\n\ @@ -73,5 +78,27 @@ autostart=true\n\ autorestart=true\n\ stopasgroup=true\n\ killasgroup=true\n\ -stderr_logfile=/var/log/ranchimallflo-api/ranchimallflo-api.err.log\n\ -stdout_logfile=/var/log/ranchimallflo-api/ranchimallflo-api.out.log" >> ranchimallflo-api.conf \ No newline at end of file +stderr_logfile=/var/log/ranchimallflo-api/ranchimallflo-api.err.log \n\ +stdout_logfile=/var/log/ranchimallflo-api/ranchimallflo-api.out.log" >> ranchimallflo-api.conf +RUN mkdir /var/log/ranchimallflo-api/ +RUN touch /var/log/ranchimallflo-api/ranchimallflo-api.err.log +RUN touch /var/log/ranchimallflo-api/ranchimallflo-api.out.log + +## Flo token tracking configuration +RUN touch ftt.conf +RUN echo "[program:ftt-docker]\n\ +directory=ftt-docker\n\ +command=tracktokens-smartcontracts.py\n\ +user=root\n\ +autostart=true\n\ +autorestart=true\n\ +stopasgroup=true\n\ +killasgroup=true\n\ +stderr_logfile=/var/log/flo-token-tracking/flo-token-tracking.err.log\n\ +stdout_logfile=/var/log/flo-token-tracking/flo-token-tracking.out.log" >> ftt.conf +RUN mkdir /var/log/flo-token-tracking +RUN touch /var/log/flo-token-tracking/flo-token-tracking.err.log +RUN touch /var/log/flo-token-tracking/flo-token-tracking.out.log + +# Run supervisor +RUN supervisorctl restart \ No newline at end of file