mirror of
https://github.com/aljazceru/python-teos.git
synced 2025-12-17 06:04:21 +01:00
Merge branch 'master' of git://github.com/aljazceru/python-teos into aljazceru-master
This commit is contained in:
9
Dockerfile
Normal file
9
Dockerfile
Normal 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" ]
|
||||
10
README.md
10
README.md
@@ -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.
|
||||
|
||||
|
||||
## 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
|
||||
|
||||
To change the configuration defaults you can:
|
||||
@@ -122,4 +130,4 @@ cp ~/.teos/teos_pk.der ~/.teos_cli/teos_pk.der
|
||||
```
|
||||
|
||||
## Contributing
|
||||
Refer to [CONTRIBUTING.md](CONTRIBUTING.md)
|
||||
Refer to [CONTRIBUTING.md](CONTRIBUTING.md)
|
||||
|
||||
30
entrypoint.sh
Executable file
30
entrypoint.sh
Executable 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
|
||||
Reference in New Issue
Block a user