This commit is contained in:
2026-06-24 16:23:52 +02:00
parent c6b96a161d
commit 4e85cdb87e
3 changed files with 19 additions and 1 deletions

View File

@@ -4,3 +4,18 @@
# Kopiraj requirements.txt, pip install, zatim kopiraj app/
# EXPOSE 8000
# CMD uvicorn app.main:app --host 0.0.0.0 --port 8000
FROM python:3.12-slim
WORKDIR /app
# Kopiraj ovisnosti PRVO — ako se ne mijenjaju, pip install se preskace (cache hit)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Kopiraj kod NAKON instalacije
COPY app/ ./app/
EXPOSE 8000
# OBAVEZNO: --host 0.0.0.0 da Ingress moze pristupiti containeru
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]

View File

@@ -3,7 +3,7 @@ from fastapi import FastAPI
app = FastAPI()
AUTOR = os.getenv("AUTOR", "nepoznat")
AUTOR = os.getenv("AUTOR", "mirko416")
@app.get("/")
def root():

View File

@@ -29,3 +29,6 @@ spec:
limits:
memory: "128Mi"
cpu: "200m"
env:
- name: AUTOR
value: mirko416