healthcheck
This commit is contained in:
@@ -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"]
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user