File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -158,6 +158,12 @@ def chat():
158158 print (f"Error in /chat endpoint: { str (e )} " )
159159 return jsonify ({"error" : str (e ), "response" : str (e )}), 500
160160
161+ @app .get ("/health" )
162+ def health_check ():
163+ """Health check endpoint"""
164+ return "ok"
165+
166+
161167# Start Flask server when this script is run directly
162168if __name__ == '__main__' :
163169
Original file line number Diff line number Diff line change @@ -13,13 +13,25 @@ services:
1313 LLM_URL : http://llm/api/v1/
1414 LLM_MODEL : default
1515 OPENAI_API_KEY : FAKE_TOKEN
16+ healthcheck :
17+ test :
18+ [
19+ " CMD" ,
20+ " python3" ,
21+ " -c" ,
22+ " import urllib.request; exit(0) if urllib.request.urlopen('http://localhost:5001/health').status == 200 else exit(1)" ,
23+ ]
24+ interval : 30s
25+ timeout : 5s
26+ retries : 3
27+ start_period : 10s
1628 depends_on :
1729 - llm
1830
1931 llm :
2032 environment :
2133 - OPENAI_API_KEY=FAKE_TOKEN
22- image : defangio/openai-access-gateway:06339c7
34+ image : defangio/openai-access-gateway
2335 ports :
2436 - target : 80
2537 published : 80
You can’t perform that action at this time.
0 commit comments