Dockerfile and entrypoint

This commit is contained in:
2020-04-05 15:17:16 +02:00
parent 307fd7dabf
commit 3ab4e57f4d
2 changed files with 32 additions and 0 deletions

11
Dockerfile Normal file
View File

@@ -0,0 +1,11 @@
FROM python:3
ENV APP_PATH=/srv/python-teos
VOLUME ["~/.teos"]
WORKDIR /srv
RUN mkdir ~/.teos && git clone https://github.com/talaia-labs/python-teos && cd python-teos && pip install -r requirements.txt && python generate_keys.py -d ~/.teos
ENV PYTHONPATH=$APP_PATH
WORKDIR /srv/python-teos
COPY entrypoint.sh /srv/python-teos/entrypoint.sh
RUN chmod +x /srv/python-teos/entrypoint.sh
ENTRYPOINT [ "/srv/python-teos/entrypoint.sh" ]
#CMD ["sh","-c","/usr/local/bin/python3 -m teos.teosd --btcrpcuser=$BTC_RPC_USER --btcrpcpassword=$BTC_RPC_PASSWD --btcrpcconnect=$BTC_RPC_HOST"]

21
entrypoint.sh Normal file
View File

@@ -0,0 +1,21 @@
#!/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
$START_COMMAND