v1.0.1 Leaner image than version 1.0.0
This commit is contained in:
parent
0d4f0f663c
commit
2632b3d785
69
Dockerfile
69
Dockerfile
@ -8,67 +8,38 @@ LABEL ranchimall="ranchimallfze@gmail.com"
|
|||||||
ENV DEBIAN_FRONTEND noninteractive
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
ENV DEBCONF_NONINTERACTIVE_SEEN true
|
ENV DEBCONF_NONINTERACTIVE_SEEN true
|
||||||
|
|
||||||
RUN apt-get update
|
RUN apt-get update && apt-get -y --no-install-recommends install python3-pip python3-venv git curl unzip supervisor libsecp256k1-dev build-essential make systemd && rm -rf /var/lib/apt/lists/*
|
||||||
RUN apt-get -y install python3-pip nano git curl python-chardet python3.9 python3.9-venv python3.8-venv unzip
|
|
||||||
RUN apt-get -y install libsecp256k1-dev libssl-dev build-essential automake pkg-config libtool libffi-dev libgmp-dev libyaml-cpp-dev pkg-config
|
|
||||||
RUN python3 -m pip install supervisor
|
|
||||||
|
|
||||||
# Installation of Pybtc, currently named as Pyflo
|
# libssl-dev automake pkg-config libtool libffi-dev libgmp-dev libyaml-cpp-dev libleveldb-dev
|
||||||
WORKDIR ../
|
|
||||||
RUN git clone https://github.com/ranchimall/pyflo
|
# Clone all required git folders
|
||||||
RUN cd pyflo && python3 setup.py install
|
WORKDIR /
|
||||||
|
RUN git clone https://github.com/ranchimall/pyflo && git clone --branch token-swap https://github.com/ranchimall/flo-token-tracking.git && git clone https://github.com/ranchimall/ranchimallflo-api && git clone https://github.com/ranchimall/floscout.git
|
||||||
|
|
||||||
# Setup of Flo Token Tracker
|
# Setup of Flo Token Tracker
|
||||||
RUN git clone --branch token-swap https://github.com/ranchimall/flo-token-tracking.git
|
WORKDIR /flo-token-tracking
|
||||||
WORKDIR flo-token-tracking
|
RUN python3 -m venv env && ./env/bin/python3 -m pip install -r requirements.txt && ./env/bin/python3 /pyflo/setup.py install && touch config.ini && touch config.py
|
||||||
RUN sed -i "s|chardet==4.0.0|chardet|g" /flo-token-tracking/requirements.txt
|
RUN if [[ $NETWORK=='test' ]] ; then echo "[DEFAULT]\nNET = testnet\nFLO_CLI_PATH = /usr/local/bin/flo-cli\nSTART_BLOCK = 740400\nFLOSIGHT_NETURL = https://testnet-flosight.duckdns.org/\nTESTNET_FLOSIGHT_SERVER_LIST = https://testnet-flosight.duckdns.org/\nMAINNET_FLOSIGHT_SERVER_LIST = https://flosight.duckdns.org/\nTOKENAPI_SSE_URL = https://ranchimallflo-testnet.duckdns.org\nDATA_PATH=/data\nIGNORE_BLOCK_LIST = 902446\nIGNORE_TRANSACTION_LIST = b4ac4ddb51188b28b39bcb3aa31357d5bfe562c21e8aaf8dde0ec560fc893174" >> /flo-token-tracking/config.ini ; else echo "[DEFAULT]\nNET = mainnet\nFLO_CLI_PATH = /usr/local/bin/flo-cli\nSTART_BLOCK = 3387900\nFLOSIGHT_NETURL = https://flosight.duckdns.org/\nTESTNET_FLOSIGHT_SERVER_LIST = https://testnet-flosight.duckdns.org/\nMAINNET_FLOSIGHT_SERVER_LIST = https://flosight.duckdns.org/\nTOKENAPI_SSE_URL = https://ranchimallflo.duckdns.org\nDATA_PATH=/data\nIGNORE_BLOCK_LIST = 902446\nIGNORE_TRANSACTION_LIST = b4ac4ddb51188b28b39bcb3aa31357d5bfe562c21e8aaf8dde0ec560fc893174" >> /flo-token-tracking/config.ini ; fi
|
||||||
RUN python3 -m venv env
|
RUN if [[ $NETWORK=='test' ]] ; then echo "committeeAddressList = ['oVwmQnQGtXjRpP7dxJeiRGd5azCrJiB6Ka'] \nsseAPI_url = 'https://ranchimallflo-testnet.duckdns.org/' \nprivKey = 'RG6Dni1fLqeT2TEFbe7RB9tuw53bDPDXp8L4KuvmYkd5JGBam6KJ' " >> /flo-token-tracking/config.py ; else echo "committeeAddressList = ['FRwwCqbP7DN4z5guffzzhCSgpD8Q33hUG8'] \nsseAPI_url = 'https://ranchimallflo.duckdns.org/' \nprivKey = 'RG6Dni1fLqeT2TEFbe7RB9tuw53bDPDXp8L4KuvmYkd5JGBam6KJ' " >> /flo-token-tracking/config.py ; fi
|
||||||
RUN python3 -m pip install chardet arrow sqlalchemy python-socketio requests
|
|
||||||
RUN touch config.ini
|
|
||||||
RUN touch config.py
|
|
||||||
|
|
||||||
|
|
||||||
RUN if [[ $NETWROKK=='test' ]] ; then echo "[DEFAULT]\nNET = testnet\nFLO_CLI_PATH = /usr/local/bin/flo-cli\nSTART_BLOCK = 740400\nFLOSIGHT_NETURL = http://0.0.0.0:9000/\nTESTNET_FLOSIGHT_SERVER_LIST = http://0.0.0.0:9000/, https://testnet-flosight.duckdns.org/\nMAINNET_FLOSIGHT_SERVER_LIST = http://0.0.0.0:9495/, https://flosight.duckdns.org/\nTOKENAPI_SSE_URL = https://ranchimallflo-testnet.duckdns.org\nDATA_PATH=/data\nIGNORE_BLOCK_LIST = 902446\nIGNORE_TRANSACTION_LIST = b4ac4ddb51188b28b39bcb3aa31357d5bfe562c21e8aaf8dde0ec560fc893174" >> /flo-token-tracking/config.ini ; else echo "[DEFAULT]\nNET = testnet\nFLO_CLI_PATH = /usr/local/bin/flo-cli\nSTART_BLOCK = 740400\nFLOSIGHT_NETURL = http://0.0.0.0:9000/\nTESTNET_FLOSIGHT_SERVER_LIST = http://0.0.0.0:9000/, https://testnet-flosight.duckdns.org/\nMAINNET_FLOSIGHT_SERVER_LIST = http://0.0.0.0:9495/, https://flosight.duckdns.org/\nTOKENAPI_SSE_URL = https://ranchimallflo-testnet.duckdns.org\nDATA_PATH=/data\nIGNORE_BLOCK_LIST = 902446\nIGNORE_TRANSACTION_LIST = b4ac4ddb51188b28b39bcb3aa31357d5bfe562c21e8aaf8dde0ec560fc893174" >> /flo-token-tracking/config.ini ; fi
|
|
||||||
RUN if [[ $NETWROKK=='test' ]] ; then echo "committeeAddressList = ['oVwmQnQGtXjRpP7dxJeiRGd5azCrJiB6Ka'] \nsseAPI_url = 'https://ranchimallflo-testnet.duckdns.org/' \nprivKey = 'RG6Dni1fLqeT2TEFbe7RB9tuw53bDPDXp8L4KuvmYkd5JGBam6KJ' " >> /flo-token-tracking/config.py ; else echo "committeeAddressList = ['oVwmQnQGtXjRpP7dxJeiRGd5azCrJiB6Ka'] \nsseAPI_url = 'https://ranchimallflo-testnet.duckdns.org/' \nprivKey = 'RG6Dni1fLqeT2TEFbe7RB9tuw53bDPDXp8L4KuvmYkd5JGBam6KJ' " >> /flo-token-tracking/config.py ; fi
|
|
||||||
|
|
||||||
# Setup of RanchimallFlo API
|
# Setup of RanchimallFlo API
|
||||||
WORKDIR ../
|
WORKDIR /ranchimallflo-api
|
||||||
RUN git clone https://github.com/ranchimall/ranchimallflo-api
|
RUN python3 -m venv env && ./env/bin/python3 -m pip install --upgrade pip setuptools wheel && ./env/bin/python3 -m pip install -r requirements.txt
|
||||||
WORKDIR ranchimallflo-api
|
RUN touch config.py && echo "dbfolder = '/data' \nsse_pubKey = '02b68a7ba52a499b4cb664033f511a14b0b8b83cd3b2ffcc7c763ceb9e85caabcf' \napiUrl = 'https://flosight.duckdns.org/api/' \napilayerAccesskey = '3abc51aa522420e4e185ac22733b0f30' \nFLO_DATA_DIR = '/home/production/.flo' " >> /ranchimallflo-api/config.py
|
||||||
RUN python3 -m pip install --upgrade pip setuptools wheel
|
|
||||||
RUN python3 -m venv env
|
|
||||||
RUN python3 -m pip install -r requirements.txt
|
|
||||||
RUN pip3 install apscheduler
|
|
||||||
RUN touch config.py
|
|
||||||
RUN echo "dbfolder = '/data' \nsse_pubKey = '02b68a7ba52a499b4cb664033f511a14b0b8b83cd3b2ffcc7c763ceb9e85caabcf' \napiUrl = 'https://flosight.duckdns.org/api/' \napilayerAccesskey = '3abc51aa522420e4e185ac22733b0f30' \nFLO_DATA_DIR = '/home/production/.flo' " >> /ranchimallflo-api/config.py
|
|
||||||
|
|
||||||
|
WORKDIR /pyflo
|
||||||
|
RUN /ranchimallflo-api/env/bin/python3 setup.py install
|
||||||
|
RUN /flo-token-tracking/env/bin/python3 setup.py install
|
||||||
|
|
||||||
# Setup of Floscout
|
# Setup of Floscout
|
||||||
WORKDIR ../
|
#WORKDIR /floscout
|
||||||
RUN git clone https://github.com/ranchimall/floscout.git
|
#RUN sed -i "s|window.tokenapiUrl = 'http://0.0.0.0:6012'|window.tokenapiUrl = $FLOAPIURL|" /floscout/index.html
|
||||||
WORKDIR floscout
|
|
||||||
RUN sed -i "s|window.tokenapiUrl = 'http://0.0.0.0:6012'|window.tokenapiUrl = $FLOAPIURL|" /floscout/index.html
|
|
||||||
WORKDIR ../
|
|
||||||
|
|
||||||
##clientside changes
|
|
||||||
#COPY flo.sh .
|
|
||||||
#RUN chmod +x flo.sh
|
|
||||||
#RUN #flo.sh
|
|
||||||
|
|
||||||
# Supervisor configurations
|
# Supervisor configurations
|
||||||
WORKDIR /etc/supervisor/conf.d/
|
WORKDIR /etc/supervisor/conf.d/
|
||||||
RUN touch ftt-ranchimallflo.conf
|
RUN touch ftt-ranchimallflo.conf
|
||||||
RUN echo "[supervisord] \nnodaemon=true\n[program:flo-token-tracking]\ndirectory=/flo-token-tracking\ncommand=/usr/bin/python3 tracktokens_smartcontracts.py\nuser=root\nautostart=true\nautorestart=false\nstopasgroup=true\nkillasgroup=true\nstderr_logfile=/var/log/flo-token-tracking/flo-token-tracking.err.log\nstdout_logfile=/var/log/flo-token-tracking/flo-token-tracking.out.log\n[program:ranchimallflo-api]\ndirectory=/ranchimallflo-api\ncommand=/usr/local/bin/hypercorn -w 1 -b 0.0.0.0:6012 wsgi:app\nuser=root\nautostart=true\nautorestart=true\nstopasgroup=true\nkillasgroup=true\nstderr_logfile=/var/log/ranchimallflo-api/ranchimallflo-api.err.log \nstdout_logfile=/var/log/ranchimallflo-api/ranchimallflo-api.out.log\n[program:floscout]\ndirectory=/floscout\ncommand=/floscout/example\nuser=root\nautostart=true\nautorestart=false\nstopasgroup=true\nkillasgroup=true\nstderr_logfile=/var/log/floscout/floscout.err.log\nstdout_logfile=/var/log/floscout/floscout.out.log" >> ftt-ranchimallflo.conf
|
RUN echo "[supervisord] \nnodaemon=true\n[program:flo-token-tracking]\ndirectory=/flo-token-tracking\ncommand=/flo-token-tracking/env/bin/python3 tracktokens_smartcontracts.py\nuser=root\nautostart=true\nautorestart=false\nstopasgroup=true\nkillasgroup=true\nstderr_logfile=/var/log/flo-token-tracking/flo-token-tracking.err.log\nstdout_logfile=/var/log/flo-token-tracking/flo-token-tracking.out.log\n[program:ranchimallflo-api]\ndirectory=/ranchimallflo-api\ncommand=/ranchimallflo-api/env/bin/hypercorn -w 1 -b 0.0.0.0:6012 wsgi:app\nuser=root\nautostart=true\nautorestart=true\nstopasgroup=true\nkillasgroup=true\nstderr_logfile=/var/log/ranchimallflo-api/ranchimallflo-api.err.log \nstdout_logfile=/var/log/ranchimallflo-api/ranchimallflo-api.out.log\n[program:floscout]\ndirectory=/floscout\ncommand=/floscout/example\nuser=root\nautostart=true\nautorestart=false\nstopasgroup=true\nkillasgroup=true\nstderr_logfile=/var/log/floscout/floscout.err.log\nstdout_logfile=/var/log/floscout/floscout.out.log\n" >> ftt-ranchimallflo.conf
|
||||||
RUN mkdir /var/log/flo-token-tracking
|
RUN mkdir /var/log/flo-token-tracking && touch /var/log/flo-token-tracking/flo-token-tracking.err.log && touch /var/log/flo-token-tracking/flo-token-tracking.out.log && mkdir /var/log/ranchimallflo-api/ && touch /var/log/ranchimallflo-api/ranchimallflo-api.err.log && touch /var/log/ranchimallflo-api/ranchimallflo-api.out.log && mkdir /var/log/floscout/ && touch /var/log/floscout/floscout.err.log && touch /var/log/floscout/floscout.out.log
|
||||||
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 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
|
|
||||||
RUN mkdir /var/log/floscout/
|
|
||||||
RUN touch /var/log/floscout/floscout.err.log
|
|
||||||
RUN touch /var/log/floscout/floscout.out.log
|
|
||||||
|
|
||||||
|
|
||||||
RUN mkdir /data
|
RUN mkdir /data
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Docker resources to build components required for FLO Token-Smart Contract system, all at one place!
|
Docker resources to build components required for FLO Token-Smart Contract system, all at one place!
|
||||||
|
|
||||||
## Why do I need this?
|
## Why do I need this?
|
||||||
|
|
||||||
FLO Token-Smart Contract system consists of three apps working together
|
FLO Token-Smart Contract system consists of three apps working together
|
||||||
* FLO Token & Smart Contract tracking scripts (Python)
|
* FLO Token & Smart Contract tracking scripts (Python)
|
||||||
@ -81,5 +81,4 @@ then
|
|||||||
echo "$FLOSCOUT_BOOTSTRAP" > /data/floscout-url.txt
|
echo "$FLOSCOUT_BOOTSTRAP" > /data/floscout-url.txt
|
||||||
ls /data
|
ls /data
|
||||||
fi
|
fi
|
||||||
```
|
```
|
||||||
|
|
||||||
10
run.sh
10
run.sh
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# prepare binary
|
# prepare binary
|
||||||
cd /mongoose-server/examples/http-server
|
cd /mongoose-server/examples/http-server
|
||||||
make
|
make
|
||||||
chmod +x example
|
chmod +x example
|
||||||
cp example /floscout
|
cp example /floscout
|
||||||
@ -29,7 +29,5 @@ cd /etc/supervisor/conf.d/
|
|||||||
sed -i "s|command=hypercorn -w 1 -b 0.0.0.0:6012 wsgi:app|command=hypercorn -w 1 -b $FLOAPIURL wsgi:app|" /etc/supervisor/conf.d/ftt-ranchimallflo.conf
|
sed -i "s|command=hypercorn -w 1 -b 0.0.0.0:6012 wsgi:app|command=hypercorn -w 1 -b $FLOAPIURL wsgi:app|" /etc/supervisor/conf.d/ftt-ranchimallflo.conf
|
||||||
sed -i "s|window.tokenapiUrl = 'https://ranchimallflo.duckdns.org'|window.tokenapiUrl = '$FLOAPIURL'|" /floscout/index.html
|
sed -i "s|window.tokenapiUrl = 'https://ranchimallflo.duckdns.org'|window.tokenapiUrl = '$FLOAPIURL'|" /floscout/index.html
|
||||||
|
|
||||||
echo "running..."
|
echo "Running Floscout"
|
||||||
supervisord -c /etc/supervisor/conf.d/ftt-ranchimallflo.conf
|
supervisord -c /etc/supervisor/conf.d/ftt-ranchimallflo.conf
|
||||||
cd /floscout
|
|
||||||
./example
|
|
||||||
Loading…
Reference in New Issue
Block a user