LiKenun commited on
Commit
5664427
·
1 Parent(s): 40a7d2c

Temporary health check server process

Browse files
Files changed (3) hide show
  1. Dockerfile +6 -1
  2. scripts/run.sh +7 -0
  3. temporary_health_check_server.py +11 -0
Dockerfile CHANGED
@@ -28,5 +28,10 @@ USER appuser
28
  # Expose a volume mount for logs ― Hugging Face Spaces requires specifically /data.
29
  VOLUME /data
30
 
 
 
 
 
 
31
  # Run the application.
32
- CMD ["python", "-m", "ctp_slack_bot.app"]
 
28
  # Expose a volume mount for logs ― Hugging Face Spaces requires specifically /data.
29
  VOLUME /data
30
 
31
+ # Temporary block for the health server fix:
32
+ COPY scripts/run.sh ./scripts/
33
+ COPY temporary_health_check_server.py ./
34
+ CMD ["./scripts/run.sh"]
35
+
36
  # Run the application.
37
+ #CMD ["python", "-m", "ctp_slack_bot.app"]
scripts/run.sh ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ parent_path=$(cd "$(dirname "${BASH_SOURCE[0]}")"; pwd -P)
4
+
5
+ cd "${parent_path}/.."
6
+
7
+ python "temporary_health_check_server.py" & python -m ctp_slack_bot.app
temporary_health_check_server.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from aiohttp import web
2
+
3
+ async def aliveness_handler(request):
4
+ return web.Response(text="Server is alive and kicking!")
5
+
6
+ app = web.Application()
7
+ app.router.add_get('/', aliveness_handler)
8
+ app.router.add_get('/health', aliveness_handler)
9
+
10
+ if __name__ == "__main__":
11
+ web.run_app(app, host='0.0.0.0', port=8080)