From 75123fa85540cb9b42d5d6cb71001e3ca765b474 Mon Sep 17 00:00:00 2001 From: lza_menace Date: Thu, 4 May 2023 12:16:59 -0700 Subject: [PATCH] adjust for compose running --- lws-web/.dockerignore | 4 ++-- lws-web/.gitignore | 2 +- lws-web/Dockerfile | 4 +--- lws-web/data/.gitignore | 0 lws-web/lws/app.py | 7 ++----- lws-web/lws/config.py | 1 + lws-web/lws/models.py | 2 +- 7 files changed, 8 insertions(+), 12 deletions(-) delete mode 100644 lws-web/data/.gitignore diff --git a/lws-web/.dockerignore b/lws-web/.dockerignore index 5c23e72..a8ca388 100644 --- a/lws-web/.dockerignore +++ b/lws-web/.dockerignore @@ -1,3 +1,3 @@ +.env .venv -*.db* -.env \ No newline at end of file +*.db \ No newline at end of file diff --git a/lws-web/.gitignore b/lws-web/.gitignore index e0f5637..463c1c8 100644 --- a/lws-web/.gitignore +++ b/lws-web/.gitignore @@ -1,3 +1,3 @@ .venv *.pyc -*.db* \ No newline at end of file +*.db \ No newline at end of file diff --git a/lws-web/Dockerfile b/lws-web/Dockerfile index 828c633..188254d 100644 --- a/lws-web/Dockerfile +++ b/lws-web/Dockerfile @@ -16,6 +16,4 @@ COPY . . RUN chown -R lws-web:lws-web . RUN python3 -m venv .venv RUN .venv/bin/pip install poetry -RUN .venv/bin/poetry install - -CMD ".venv/bin/poetry run start" \ No newline at end of file +RUN .venv/bin/poetry install \ No newline at end of file diff --git a/lws-web/data/.gitignore b/lws-web/data/.gitignore deleted file mode 100644 index e69de29..0000000 diff --git a/lws-web/lws/app.py b/lws-web/lws/app.py index f5f1535..b839988 100644 --- a/lws-web/lws/app.py +++ b/lws-web/lws/app.py @@ -1,7 +1,4 @@ from lws.factory import create_app +from lws import config - -app = create_app() - -if __name__ == '__main__': - app.run() +run = create_app().run(host=config.HOST) diff --git a/lws-web/lws/config.py b/lws-web/lws/config.py index fa5776e..1338562 100644 --- a/lws-web/lws/config.py +++ b/lws-web/lws/config.py @@ -4,6 +4,7 @@ from dotenv import load_dotenv load_dotenv() +HOST = env.get("HOST", "127.0.0.1") TEMPLATES_AUTO_RELOAD = True DEBUG = 1 == env.get("DEBUG", 1) QUART_ENV = env.get("QUART_ENV", "development") diff --git a/lws-web/lws/models.py b/lws-web/lws/models.py index 8a8696c..55ffefd 100644 --- a/lws-web/lws/models.py +++ b/lws-web/lws/models.py @@ -6,7 +6,7 @@ from peewee import * from lws import config -db = SqliteDatabase('data/lws.db') +db = SqliteDatabase('lws.db') class User(Model):