Skip to content

Commit 769d95f

Browse files
committed
contribs-portals healthchecks
1 parent 2d7c9cb commit 769d95f

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

mpcontribs-portal/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ COPY manage.py .
6969
COPY start.sh .
7070
COPY maintenance.py .
7171
COPY gunicorn.conf.py .
72+
COPY healthchecks.py .
7273

7374
ARG VERSION
7475
ENV DD_SERVICE=contribs-portals \

mpcontribs-portal/healthchecks.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import os
2+
import sys
3+
import requests
4+
5+
for deployment in os.environ.get("DEPLOYMENTS", "ml:10002").split(","):
6+
name, _, _, port = deployment.split(":")
7+
response = requests.get(f"http://localhost:{port}/healthcheck")
8+
if response.status_code != 200:
9+
sys.exit(1)

0 commit comments

Comments
 (0)