healthcheck

This commit is contained in:
2022-02-25 01:46:00 +01:00
parent 9fb29ab038
commit 78a97db320
2 changed files with 6 additions and 0 deletions
+1
View File
@@ -5,4 +5,5 @@ RUN pip install -r requirements.txt
EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD [ "curl", "-sSf", "localhost:8000" ]
ENTRYPOINT ["python", "__main__.py"]
+5
View File
@@ -20,8 +20,13 @@ RABBIT_PORT = os.environ.get("RABBIT_PORT") or "5672"
app = FastAPI()
def get_connexion():
"""Return the RabbitMQ connexion object."""
return pika.BlockingConnection(pika.ConnectionParameters(RABBIT_HOST+":"+RABBIT_PORT))
@app.get("/live")
def healthcheck():
"""Health check for Docker."""
return "OK"
@app.get("/{repo}")
def webhook(repo: str):