Files
hello-cicd/main.py
sz11zs c51b9b8af3
Some checks failed
CI/CD Pipeline / build (push) Successful in 1m27s
CI/CD Pipeline / deploy (push) Failing after 1m8s
downgrade to v3
2026-05-02 20:51:27 +02:00

23 lines
500 B
Python

from fastapi import FastAPI
import os
app = FastAPI()
_healthy = True
@app.get("/health")
def health():
if not _healthy:
return {"status": "unhealthy"}, 503
return {"status": "ok"}
@app.post("/break")
def break_health():
"""Simulira pad servisa za testiranje liveness probe-a"""
global _healthy
_healthy = False
return {"message": "Servis je sada nezdrav — ocekuj restart"}
@app.get("/")
def read_root():
return {"poruka": "Hello iz mog Docker containera!"}