From d23c4b08c679d03df414df1a38be8a7c02788ddd Mon Sep 17 00:00:00 2001 From: Henrik Jess Date: Tue, 10 Dec 2024 15:26:30 +0100 Subject: [PATCH] First real commit --- Dockerfile | 4 ++-- app.py | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7b8a42c..73fdfcc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ RUN pip install --no-cache-dir -r requirements.txt COPY . . # Expose the port the FastAPI app runs on (default Uvicorn port) -EXPOSE 5000 +EXPOSE 9210 # Command to run the FastAPI application -CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "5000", "--workers", "1"] \ No newline at end of file +CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "9210", "--workers", "1"] \ No newline at end of file diff --git a/app.py b/app.py index 5221b4f..2cc2664 100644 --- a/app.py +++ b/app.py @@ -1,3 +1,4 @@ +import uvicorn from fastapi import FastAPI from dotenv import load_dotenv import os @@ -8,4 +9,8 @@ app = FastAPI(title=os.getenv("APP_NAME", "Default App")) @app.get("/") def read_root(): - return {"debug": os.getenv("DEBUG", "false")} \ No newline at end of file + return {"debug": os.getenv("DEBUG", "false")} + + +if __name__ == "__main__": + uvicorn.run("app:app", host="0.0.0.0", port=9210, reload=True) \ No newline at end of file