fixed db export
This commit is contained in:
parent
2d796a34ed
commit
2b58f7a45d
3 changed files with 17 additions and 4 deletions
|
|
@ -46,4 +46,4 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
|
|||
CMD python -c "import requests; requests.get('http://localhost:8000/api/admin/health', timeout=5)" || exit 1
|
||||
|
||||
# Run the application
|
||||
CMD exec uvicorn app:app --host 0.0.0.0 --port ${PORT:-8000} --workers 1 --timeout-graceful-shutdown 5
|
||||
CMD exec gunicorn app:app --bind 0.0.0.0:${PORT:-8000} --timeout 600 --worker-class uvicorn.workers.UvicornWorker --workers 1
|
||||
|
|
|
|||
16
app.py
16
app.py
|
|
@ -730,7 +730,19 @@ logger.info(f"Feature router load results: {featureLoadResults}")
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import uvicorn
|
||||
|
||||
port = int(os.environ.get("PORT", 8000))
|
||||
|
||||
try:
|
||||
from gunicorn.app.wsgiapp import WSGIApplication # noqa: F401
|
||||
import subprocess
|
||||
import sys
|
||||
subprocess.run([
|
||||
sys.executable, "-m", "gunicorn", "app:app",
|
||||
"--bind", f"0.0.0.0:{port}",
|
||||
"--timeout", "600",
|
||||
"--worker-class", "uvicorn.workers.UvicornWorker",
|
||||
"--workers", "1",
|
||||
], check=True)
|
||||
except ImportError:
|
||||
import uvicorn
|
||||
uvicorn.run("app:app", host="0.0.0.0", port=port, workers=1, timeout_graceful_shutdown=5)
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
fastapi==0.115.0 # Upgraded for Pydantic v2 compatibility
|
||||
websockets==12.0
|
||||
uvicorn==0.23.2
|
||||
gunicorn==23.0.0
|
||||
python-multipart==0.0.6
|
||||
httpx>=0.25.2
|
||||
pydantic>=2.0.0 # Upgraded to v2 for compatibility
|
||||
|
|
|
|||
Loading…
Reference in a new issue