Claude Code Claude Opus 4.6 commited on
Commit
15b06d3
·
1 Parent(s): bad336e

Claude Code: Add strict error handling and logging to entrypoint.sh

Browse files

- Add explicit set -e for error abort
- Create /workspace/logs directory
- Log uvicorn output to both file and stdout via tee

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Files changed (1) hide show
  1. entrypoint.sh +7 -3
entrypoint.sh CHANGED
@@ -1,4 +1,5 @@
1
- #!/bin/bash -e
 
2
  # Entrypoint for HuggingClaw - Cain
3
 
4
  echo "=========================================="
@@ -22,10 +23,13 @@ echo ""
22
  echo "Files in /app:"
23
  ls -la /app/*.py 2>/dev/null || echo " (no .py files in /app root)"
24
 
 
 
 
25
  echo ""
26
  echo "=========================================="
27
  echo "Starting uvicorn..."
28
  echo "=========================================="
29
 
30
- # Run uvicorn directly - keep container running
31
- exec uvicorn app:app --host 0.0.0.0 --port "${PORT:-7860}"
 
1
+ #!/bin/bash
2
+ set -e
3
  # Entrypoint for HuggingClaw - Cain
4
 
5
  echo "=========================================="
 
23
  echo "Files in /app:"
24
  ls -la /app/*.py 2>/dev/null || echo " (no .py files in /app root)"
25
 
26
+ # Create logs directory
27
+ mkdir -p /workspace/logs
28
+
29
  echo ""
30
  echo "=========================================="
31
  echo "Starting uvicorn..."
32
  echo "=========================================="
33
 
34
+ # Run uvicorn with logging to both file and stdout
35
+ uvicorn app:app --host 0.0.0.0 --port "${PORT:-7860}" 2>&1 | tee /workspace/logs/server.log