From 3cae914258b1c1b5d8cd0a143020d40a512d181c Mon Sep 17 00:00:00 2001 From: Anderson T Date: Fri, 29 Dec 2023 16:11:35 -0800 Subject: [PATCH] refactor file layout --- .dockerignore | 2 -- Dockerfile | 3 +-- main.py | 4 ++-- api.py => python/api.py | 0 discord.py => python/discord.py | 0 5 files changed, 3 insertions(+), 6 deletions(-) delete mode 100644 .dockerignore rename api.py => python/api.py (100%) rename discord.py => python/discord.py (100%) diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 6236c8a..0000000 --- a/.dockerignore +++ /dev/null @@ -1,2 +0,0 @@ -database/ -venv/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 294b788..97bde1b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,9 +5,8 @@ COPY requirements.txt requirements.txt RUN pip3 install -r requirements.txt --no-cache-dir option # copy all files -COPY api.py api.py +COPY /python /python COPY main.py main.py -COPY discord.py discord.py # run code CMD ["python3", "main.py"] \ No newline at end of file diff --git a/main.py b/main.py index b31c1ba..7e8128a 100644 --- a/main.py +++ b/main.py @@ -8,7 +8,7 @@ import gzip from LangaraCourseInfo import Database, Utilities -from discord import send_webhook +from python.discord import send_webhook import os from dotenv import load_dotenv @@ -76,7 +76,7 @@ def refreshSemester(u:Utilities, discord_url:str = None) -> None: # Launch web server def start_uvicorn(): print("Launching uvicorn.") - uvicorn.run("api:app", host="0.0.0.0", port=5000) + uvicorn.run("python.api:app", host="0.0.0.0", port=5000) def start_refreshing(): diff --git a/api.py b/python/api.py similarity index 100% rename from api.py rename to python/api.py diff --git a/discord.py b/python/discord.py similarity index 100% rename from discord.py rename to python/discord.py