fix(pagination): Fix #95. Switch from eventlet to gevent
This commit is contained in:
@@ -5,6 +5,9 @@ WORKDIR /app
|
||||
# Bricktracker
|
||||
COPY . .
|
||||
|
||||
# Fix line endings and set executable permissions for entrypoint script
|
||||
RUN sed -i 's/\r$//' entrypoint.sh && chmod +x entrypoint.sh
|
||||
|
||||
# Python library requirements
|
||||
RUN pip --no-cache-dir install -r requirements.txt
|
||||
|
||||
|
||||
@@ -13,4 +13,4 @@ then
|
||||
fi
|
||||
|
||||
# Execute the WSGI server
|
||||
gunicorn --bind "${BK_SERVER}:${BK_PORT}" "app:create_app()" --worker-class "eventlet" "$@"
|
||||
gunicorn --bind "${BK_HOST}:${BK_PORT}" "wsgi:application" --worker-class "gevent" --workers 1 "$@"
|
||||
|
||||
38
wsgi.py
Normal file
38
wsgi.py
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
WSGI entry point for BrickTracker - Production Docker deployment
|
||||
This ensures proper gevent monkey patching for gunicorn
|
||||
"""
|
||||
|
||||
# CRITICAL: This must be the very first import
|
||||
import gevent.monkey
|
||||
gevent.monkey.patch_all()
|
||||
|
||||
import logging
|
||||
import sys
|
||||
import os
|
||||
|
||||
# Add the current directory to Python path
|
||||
sys.path.insert(0, os.path.dirname(__file__))
|
||||
|
||||
# Import Flask and BrickTracker modules directly
|
||||
from flask import Flask
|
||||
from bricktracker.app import setup_app
|
||||
from bricktracker.socket import BrickSocket
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# Create the Flask app directly (bypassing app.py to avoid double monkey patching)
|
||||
app = Flask(__name__)
|
||||
|
||||
# Setup the app
|
||||
setup_app(app)
|
||||
|
||||
# Create the socket
|
||||
socket_instance = BrickSocket(
|
||||
app,
|
||||
threaded=not app.config['NO_THREADED_SOCKET'],
|
||||
)
|
||||
|
||||
# Export the Flask app for gunicorn
|
||||
application = app
|
||||
Reference in New Issue
Block a user