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():
158
158
print (f"Error in /chat endpoint: { str (e )} " )
159
159
return jsonify ({"error" : str (e ), "response" : str (e )}), 500
160
160
161
+ @app .get ("/health" )
162
+ def health_check ():
163
+ """Health check endpoint"""
164
+ return "ok"
165
+
166
+
161
167
# Start Flask server when this script is run directly
162
168
if __name__ == '__main__' :
163
169
Original file line number Diff line number Diff line change @@ -13,13 +13,25 @@ services:
13
13
LLM_URL : http://llm/api/v1/
14
14
LLM_MODEL : default
15
15
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
16
28
depends_on :
17
29
- llm
18
30
19
31
llm :
20
32
environment :
21
33
- OPENAI_API_KEY=FAKE_TOKEN
22
- image : defangio/openai-access-gateway:06339c7
34
+ image : defangio/openai-access-gateway
23
35
ports :
24
36
- target : 80
25
37
published : 80
You can’t perform that action at this time.
0 commit comments