add run.sh CMD in Dockerfile

This commit is contained in:
2024-08-12 09:30:42 +03:00
parent ef208dbc83
commit 604840eef9
4 changed files with 98 additions and 30 deletions

23
docker/healthy_check.py Normal file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/python
import sys
import os
import xmlrpclib
import json
api_user=os.getenv('BITMESSAGE_API_USER', 'bitmessage_api_user') ;
api_password=os.getenv('BITMESSAGE_API_PASSWORD', 'bitmessage_api_password') ;
api_port=os.getenv('BITMESSAGE_API_PORT', '8442') ;
api_link="http://{}:{}@127.0.0.1:{}/".format(api_user, api_password, api_port)
api = xmlrpclib.ServerProxy(api_link)
network_connections=json.loads(api.clientStatus())['networkConnections']
print "networkConnections:", network_connections
if network_connections > 0:
sys.exit(0)
else:
sys.exit(1)