diff --git a/compose.yml b/compose.yml index 17bcf22..0a42856 100644 --- a/compose.yml +++ b/compose.yml @@ -9,7 +9,7 @@ services: environment: - PYTHONDONTWRITEBYTECODE=1 - PYTHONUNBUFFERED=1 - entrypoint: ["gunicorn", "-w", "1", "-k", "aiohttp.worker.GunicornWebWorker", "snek.gunicorn:app","--bind","0.0.0.0:8081"] + entrypoint: ["gunicorn", "-w", "4", "-k", "aiohttp.worker.GunicornWebWorker", "snek.gunicorn:app","--bind","0.0.0.0:8081"] #entrypoint: ["python","-m","snek.app"] snecssh: build: diff --git a/src/snek/app.py b/src/snek/app.py index 0fc1016..8a3481e 100644 --- a/src/snek/app.py +++ b/src/snek/app.py @@ -127,8 +127,10 @@ class Application(BaseApplication): return await super().render_template(template, request, context) + +app = Application(db_path="sqlite:///snek.db") + async def main(): - app = Application(db_path="sqlite:///snek.db") await web._run_app(app, port=8081, host="0.0.0.0") if __name__ == "__main__":