Compare commits
1 Commits
e1dc7bc5c9
...
dc08ba41ca
Author | SHA1 | Date | |
---|---|---|---|
dc08ba41ca |
@@ -4,10 +4,15 @@ FROM python:3.13.1-slim-bookworm
|
||||
COPY requirements.txt /app/requirements.txt
|
||||
RUN pip install --no-cache-dir -r /app/requirements.txt
|
||||
|
||||
# Install curl
|
||||
RUN apt-get update && apt-get install -y curl
|
||||
|
||||
# Copy the application
|
||||
COPY main.py /app
|
||||
COPY utils/ /app/utils
|
||||
WORKDIR /app
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD curl -f http://localhost/heartbeat || exit 1
|
||||
|
||||
# Run the application
|
||||
CMD ["python", "main.py"]
|
@@ -24,6 +24,11 @@ class Handler(BaseHTTPRequestHandler):
|
||||
self.wfile.write(b'404 Not Found')
|
||||
|
||||
def do_GET(self):
|
||||
self.send_response(404)
|
||||
self.end_headers()
|
||||
self.wfile.write(b'404 Not Found')
|
||||
if self.path == '/heartbeat':
|
||||
self.send_response(200)
|
||||
self.end_headers()
|
||||
self.wfile.write(b'Heartbeat OK')
|
||||
else:
|
||||
self.send_response(404)
|
||||
self.end_headers()
|
||||
self.wfile.write(b'404 Not Found')
|
Reference in New Issue
Block a user