🔧 Copied self hosted docker apps
This commit is contained in:
parent
36943e27da
commit
abc55d8ed5
209 changed files with 58596 additions and 0 deletions
15
self_host/LibreTranslate/scripts/healthcheck.py
Normal file
15
self_host/LibreTranslate/scripts/healthcheck.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import requests
|
||||
import os
|
||||
|
||||
port = os.environ.get('LT_PORT', '5000')
|
||||
response = requests.post(
|
||||
url=f'http://localhost:{port}/translate',
|
||||
headers={'Content-Type': 'application/json'},
|
||||
json={
|
||||
'q': 'Hello World!',
|
||||
'source': 'en',
|
||||
'target': 'en'
|
||||
},
|
||||
timeout=60
|
||||
)
|
||||
response.raise_for_status() # if server unavailable then requests with raise exception and healthcheck will fail
|
||||
Loading…
Add table
Add a link
Reference in a new issue