mirror of
https://github.com/fromchat-messenger/web.git
synced 2026-09-22 19:15:08 +03:00
Add multi-service Docker setup, Postgres migrations, and messaging API cleanup
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Simple health check script using built-in urllib
|
||||
Replaces curl dependency in Docker health checks
|
||||
"""
|
||||
|
||||
import sys
|
||||
import urllib.request
|
||||
import os
|
||||
|
||||
def main():
|
||||
port = os.getenv('PORT', '8300')
|
||||
url = f'http://localhost:{port}/health'
|
||||
|
||||
try:
|
||||
with urllib.request.urlopen(url, timeout=10) as response:
|
||||
if response.status == 200:
|
||||
print("OK")
|
||||
sys.exit(0)
|
||||
else:
|
||||
print(f"HTTP {response.status}")
|
||||
sys.exit(1)
|
||||
except Exception as e:
|
||||
print(f"FAILED: {e}")
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user