Skip to content

Commit

Permalink
run API only
Browse files Browse the repository at this point in the history
  • Loading branch information
yoomlam committed Jun 7, 2024
1 parent 1b3fc83 commit 4c96309
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions 05-assistive-chatbot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ ENV PYTHONUNBUFFERED=1
# To prevent files from being copied into the image, update .dockerignore
COPY --chown=tron . .

RUN ./ingest-guru-cards.py
# RUN ./ingest-guru-cards.py

EXPOSE 8000
HEALTHCHECK CMD curl http://localhost:8000 || exit 1
ENTRYPOINT ["chainlit", "run", "--port", "8000", "-h", "chatbot-chainlit.py"]
ENTRYPOINT ["chainlit", "run", "--port", "8000", "-h", "chatbot_api.py"]
8 changes: 6 additions & 2 deletions 05-assistive-chatbot/chatbot_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import logging
import os
import socket
from functools import cached_property
from typing import Dict

Expand Down Expand Up @@ -56,8 +57,11 @@ def healthcheck(request: Request):
git_sha = os.environ.get("GIT_SHA", "")
build_date = os.environ.get("BUILD_DATE", "")

logger.info("Returning: Healthy %s %s", build_date, git_sha)
return HTMLResponse(f"Healthy {build_date} {git_sha}")
hostname = socket.gethostname()
ip = socket.gethostbyname(hostname)

logger.info("Returning: Healthy %s %s %s %s", build_date, git_sha, hostname, ip)
return HTMLResponse(f"Healthy {build_date} {git_sha} {hostname} {ip}")


if __name__ == "__main__":
Expand Down

0 comments on commit 4c96309

Please sign in to comment.