commit 35d8ce85593661a31e1dce87acdab71fad8017e1 Author: DinkoGalic Date: Tue Jun 9 10:11:07 2026 +0200 init diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..e69de29 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f0c4fbe --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +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..bc5c688 --- /dev/null +++ b/app/main.py @@ -0,0 +1,14 @@ +import os +from fastapi import FastAPI + +app = FastAPI() + +AUTOR = os.getenv("dinkoglc", "nepoznat") + +@app.get("/") +def root(): + return {"message": "Kolokvij 2", "autor": "dinkoglc"} + +@app.get("/health") +def health(): + return {"status": "ok"} diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml new file mode 100644 index 0000000..e69de29 diff --git a/k8s/ingress.yaml b/k8s/ingress.yaml new file mode 100644 index 0000000..e69de29 diff --git a/k8s/service.yaml b/k8s/service.yaml new file mode 100644 index 0000000..e69de29 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..c83aa69 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +fastapi==0.111.0 +uvicorn[standard]==0.29.0