Merge branch 'master' of git://github.com/aljazceru/python-teos into aljazceru-master

This commit is contained in:
Sergi Delgado Segura
2020-06-05 13:27:48 +02:00
3 changed files with 48 additions and 1 deletions

9
Dockerfile Normal file
View File

@@ -0,0 +1,9 @@
FROM python:3
ENV APP_PATH=/srv/python-teos
VOLUME ["~/.teos"]
WORKDIR /srv
RUN mkdir ~/.teos && git clone https://github.com/aljazceru/python-teos.git && cd python-teos && pip install -r requirements.txt && python generate_keys.py -d ~/.teos
ENV PYTHONPATH=$APP_PATH
WORKDIR /srv/python-teos
EXPOSE 9814/tcp
ENTRYPOINT [ "/srv/python-teos/entrypoint.sh" ]

View File

@@ -37,6 +37,14 @@ The configuration includes, amongst others, where your data folder is placed, wh
To run `teos` you need a set of keys (to sign appointments) stored in your data directory. You can follow [generate keys](#generate-keys) to generate them. To run `teos` you need a set of keys (to sign appointments) stored in your data directory. You can follow [generate keys](#generate-keys) to generate them.
## Running `teos` as a docker container
`teos` container can be build from Dockerfile attached to the repo. ENV variables are optional, if not set defaults are used.
git clone https://github.com/talaia-labs/python-teos
cd python-teos
docker build . -t teos
docker run -it -e BTC_RPC_USER=<rpc username> -e BTC_RPC_PASSWD=<rpc password> -e BTC_RPC_HOST=<hostname> -e BTC_RPC_PORT=<port> -p 9814:9814/tcp teos
### Configuration file and command line parameters ### Configuration file and command line parameters
To change the configuration defaults you can: To change the configuration defaults you can:

30
entrypoint.sh Executable file
View File

@@ -0,0 +1,30 @@
#!/bin/bash
START_COMMAND="/usr/local/bin/python3 -m teos.teosd "
if [[ ! -z ${BTC_RPC_USER} ]]; then
START_COMMAND=$START_COMMAND" --btcrpcuser=""$BTC_RPC_USER"
fi
if [[ ! -z ${BTC_RPC_HOST} ]]; then
START_COMMAND=$START_COMMAND" --btcrpcconnect=""$BTC_RPC_HOST"
fi
if [[ ! -z ${BTC_RPC_PASSWD} ]]; then
START_COMMAND=$START_COMMAND" --btcrpcpassword=""$BTC_RPC_PASSWD"
fi
if [[ ! -z ${BTC_NETWORK} ]]; then
START_COMMAND=$START_COMMAND" --btcnetwork=""$BTC_NETWORK"
fi
if [[ ! -z ${API_CONNECT} ]]; then
START_COMMAND=$START_COMMAND" --apiconnect=""$API_CONNECT"
fi
if [[ ! -z ${API_PORT} ]]; then
START_COMMAND=$START_COMMAND" --apiport=""$API_PORT"
fi
$START_COMMAND