diff --git a/Dockerfile b/Dockerfile index 282f994..573f83f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,4 +16,4 @@ RUN apt-get update && \ COPY ./lib /app/lib -CMD ["gunicorn", "-c", "lib/settings/gunicorn.py", "-w", "1", "--threads=2", "-k", "uvicorn.workers.UvicornWorker", "lib:app", "--log-level", "Debug", "-b", "0.0.0.0:3000", "--timeout", "30"] +CMD ["gunicorn", "-c", "lib/settings/gunicorn.py", "-w", "1", "--threads=2", "-k", "uvicorn.workers.UvicornWorker", "lib.api:app", "--log-level", "Debug", "-b", "0.0.0.0:3000", "--timeout", "30"] diff --git a/lib/__init__.py b/lib/__init__.py index db869db..2f27218 100644 --- a/lib/__init__.py +++ b/lib/__init__.py @@ -23,6 +23,3 @@ def parse_error(error): exc_type = type(error).__name__ exc_obj = f"{error}".replace("\n", " ").replace(" ", " ") return f"{exc_type} exception: {exc_obj}" - - -from .api import app # noqa diff --git a/lib/__main__.py b/lib/__main__.py index 311e8bf..9be9014 100644 --- a/lib/__main__.py +++ b/lib/__main__.py @@ -1,5 +1,5 @@ # __main__.py -from lib import app +from lib.api import app if __name__ == '__main__': app.run() diff --git a/lib/settings/gunicorn.py b/lib/settings/gunicorn.py index 7190073..b85352d 100644 --- a/lib/settings/gunicorn.py +++ b/lib/settings/gunicorn.py @@ -10,7 +10,7 @@ def post_fork(server, worker): # pylint: disable=unused-argument service_version="1.2.0", deployment_environment="production", ) - from lib import ( # pylint: disable=import-outside-toplevel + from lib.api import ( # pylint: disable=import-outside-toplevel app as fastapi_server, )