From 92f40fc42a7925e034298af70dbb73744b78a877 Mon Sep 17 00:00:00 2001 From: IvaCerkez Date: Mon, 25 May 2026 16:06:47 +0200 Subject: [PATCH] fix cpu quota for fastapi deploy --- Dockerfile | 19 +++++++++++++++++++ app/main.py | 19 +++++++++++++++++++ manifesti | 1 + requirments.txt | 2 ++ 4 files changed, 41 insertions(+) create mode 100644 Dockerfile create mode 100644 app/main.py create mode 160000 manifesti create mode 100644 requirments.txt diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a4bde51 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM python:3.12-slim + + +WORKDIR /app + + +COPY requirments.txt . + + +RUN pip install --no-cache-dir -r requirments.txt + + +COPY app ./app/ + + +EXPOSE 8000 + + +CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file diff --git a/app/main.py b/app/main.py new file mode 100644 index 0000000..be5e392 --- /dev/null +++ b/app/main.py @@ -0,0 +1,19 @@ +from fastapi import FastAPI +import platform + +app = FastAPI() + +@app.get("/") +def root(): + return {"poruka": "Hello iz mog Docker containera v2!"} + +@app.get("/info") +def info(): + return { + "python": platform.python_version(), + "verzija": "2.0" + } + +@app.get("/health") +def health(): + return {"status": "ok"} diff --git a/manifesti b/manifesti new file mode 160000 index 0000000..7359d34 --- /dev/null +++ b/manifesti @@ -0,0 +1 @@ +Subproject commit 7359d34a7892ba66cce4e5abcd13683e71b1687a diff --git a/requirments.txt b/requirments.txt new file mode 100644 index 0000000..37c4b0e --- /dev/null +++ b/requirments.txt @@ -0,0 +1,2 @@ +fastapi == 0.111.0 +uvicorn[standard]==0.29.0 \ No newline at end of file