From cedb45d06b08f77b50e89700c41a3560559e2a00 Mon Sep 17 00:00:00 2001 From: filip susak Date: Tue, 31 Mar 2026 09:44:20 +0200 Subject: [PATCH] Initial commit --- app/main.py | 10 ++++++++++ dockerfile | 7 +++++++ requirements.txt | 2 ++ 3 files changed, 19 insertions(+) create mode 100644 app/main.py create mode 100644 dockerfile create mode 100644 requirements.txt diff --git a/app/main.py b/app/main.py new file mode 100644 index 0000000..1745c0f --- /dev/null +++ b/app/main.py @@ -0,0 +1,10 @@ +from fastapi import FastAPI +app = FastAPI() +@app.get("/") + +def root(): + return {"message": "Pozdrav svijetu!"} + +@app.get("/health") +def health(): + return {"status": "ok"} diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..137ddde --- /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"] diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..d274f00 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +fastapi == 0.111.0 +uvicorn == 0.29.0 \ No newline at end of file