From e5ed302b4db0715ef3472e461d2b25d22787a4de Mon Sep 17 00:00:00 2001 From: Leonarda Prusina Date: Thu, 30 Apr 2026 20:43:11 +0200 Subject: [PATCH] add: liveness and readiness probes --- Dockerfile | 13 +++++++++++++ app/main.py | 11 +++++++++++ manifesti | 1 + requirements.txt | 2 ++ 4 files changed, 27 insertions(+) create mode 100644 Dockerfile create mode 100644 app/main.py create mode 160000 manifesti create mode 100644 requirements.txt diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9d39ab9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM python:3.12-slim + +WORKDIR /app + +COPY requirements.txt . + +RUN pip install --no-cache-dir -r requirements.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..866c7c2 --- /dev/null +++ b/app/main.py @@ -0,0 +1,11 @@ +from fastapi import FastAPI + +app = FastAPI() + +@app.get("/") +def root(): + return {"message": "Pozdrav svijete"} + +@app.get("/health") +def health(): + return {"status": "ok"} \ No newline at end of file diff --git a/manifesti b/manifesti new file mode 160000 index 0000000..78275ea --- /dev/null +++ b/manifesti @@ -0,0 +1 @@ +Subproject commit 78275ea48167f104b082b85fd2fa6293138d426e diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..d50dc68 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +fastapi==0.111.0 +uvicorn[standard]==0.29.0 \ No newline at end of file