From 8a20124859c7af0db30538d40c25e1477e8f1763 Mon Sep 17 00:00:00 2001 From: DarkSlein Date: Tue, 1 Jul 2025 10:42:14 +0300 Subject: [PATCH] Added gunicorn --- Dockerfile | 2 ++ src/app.py | 14 +++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0226354..ed91d61 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,4 +10,6 @@ RUN pip3 install gunicorn==21.2.0 gevent-websocket==0.10.1 COPY . . +ENV PYTHONPATH="${PYTHONPATH}:/app" + CMD ["gunicorn", "-b", "0.0.0.0:5000", "-k", "geventwebsocket.gunicorn.workers.GeventWebSocketWorker", "--workers", "1", "src.app:app"] \ No newline at end of file diff --git a/src/app.py b/src/app.py index 0752521..2779a9d 100644 --- a/src/app.py +++ b/src/app.py @@ -5,14 +5,14 @@ from werkzeug.serving import run_simple from flask_cors import CORS from pymongo import MongoClient -from config import Config -from singletons.database_singleton import DatabaseSingleton +from .config import Config +from .singletons.database_singleton import DatabaseSingleton -from infra.server import app, socketio -from controllers.user_controller import user_blueprint -from controllers.reservation_controller import reservation_blueprint -from controllers.health_controller import health_blueprint -from controllers.room_controller import room_blueprint +from .infra.server import app, socketio +from .controllers.user_controller import user_blueprint +from .controllers.reservation_controller import reservation_blueprint +from .controllers.health_controller import health_blueprint +from .controllers.room_controller import room_blueprint CORS(app) app.config['JWT_SECRET_KEY'] = Config.JWT_SECRET_KEY