Skip to content

Commit 9a986a9

Browse files
committed
feat: Run API server with Gunicorn for improved performance and concurrency
1 parent 8c26ec6 commit 9a986a9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

backend/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,7 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
4343
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
4444
CMD curl -f http://localhost:5000/health || exit 1
4545

46-
# Run the API server
47-
CMD ["python", "app/app.py"]
46+
# Run the API server with Gunicorn (production-ready WSGI server)
47+
# Bind to 0.0.0.0:5000 to match healthcheck and docker-compose expectations
48+
# Use 2 workers and 2 threads for light concurrency; adjust as needed
49+
CMD ["gunicorn", "-w", "2", "--threads", "2", "-b", "0.0.0.0:5000", "app.app:app", "--timeout", "90"]

0 commit comments

Comments
 (0)