fix: agent Dockerfile package structure and Dead container crash
- Dockerfile: COPY to /app/agent/ and use agent.main:app for proper package imports - docker_ops: use low-level API in get_health() to avoid NotFound on containers stuck in Docker Dead state - Add comprehensive README with architecture, API docs, and usage Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+2
-2
@@ -7,8 +7,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
COPY . /app/agent/
|
||||
|
||||
EXPOSE 8889
|
||||
|
||||
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8889"]
|
||||
CMD ["uvicorn", "agent.main:app", "--host", "0.0.0.0", "--port", "8889"]
|
||||
|
||||
+6
-2
@@ -217,8 +217,12 @@ class DockerOps:
|
||||
return {"success": False, "message": str(exc)}
|
||||
|
||||
def get_health(self) -> dict:
|
||||
"""Return node health info: hostname and container count."""
|
||||
containers = self.client.containers.list(all=True)
|
||||
"""Return node health info: hostname and container count.
|
||||
|
||||
Uses the low-level API to avoid NotFound errors from containers
|
||||
stuck in Docker's 'Dead' state.
|
||||
"""
|
||||
containers = self.client.api.containers(all=True)
|
||||
return {
|
||||
"status": "healthy",
|
||||
"hostname": socket.gethostname(),
|
||||
|
||||
Reference in New Issue
Block a user