liaoch commited on
Commit
3ce63f2
·
1 Parent(s): 5faa943

Add healthz endpoint and increase Gunicorn timeout

Browse files
Files changed (2) hide show
  1. Dockerfile +1 -1
  2. app.py +3 -0
Dockerfile CHANGED
@@ -95,4 +95,4 @@ ENTRYPOINT []
95
  # Use the port defined by FLASK_RUN_PORT
96
  # The number of workers (e.g., --workers 3) can be adjusted based on server resources
97
  # Use JSON form with the absolute path to gunicorn in the venv to avoid PATH issues
98
- CMD ["/app/venv/bin/gunicorn", "--workers", "3", "--bind", "0.0.0.0:5001", "app:app"]
 
95
  # Use the port defined by FLASK_RUN_PORT
96
  # The number of workers (e.g., --workers 3) can be adjusted based on server resources
97
  # Use JSON form with the absolute path to gunicorn in the venv to avoid PATH issues
98
+ CMD ["/app/venv/bin/gunicorn", "--workers", "3", "--bind", "0.0.0.0:5001", "--timeout", "60", "app:app"]
app.py CHANGED
@@ -175,6 +175,9 @@ def preview_mermaid():
175
  except OSError as e:
176
  logging.error(f"Error deleting temporary input file {input_path} after download: {e}")
177
 
 
 
 
178
 
179
  if __name__ == '__main__':
180
  # For local development only (use Gunicorn/Waitress in production)
 
175
  except OSError as e:
176
  logging.error(f"Error deleting temporary input file {input_path} after download: {e}")
177
 
178
+ @app.route('/healthz')
179
+ def healthz():
180
+ return "OK", 200
181
 
182
  if __name__ == '__main__':
183
  # For local development only (use Gunicorn/Waitress in production)