abdibrahem commited on
Commit
9f5fcda
·
1 Parent(s): 5a2f596
Files changed (2) hide show
  1. Dockerfile +3 -5
  2. main.py +1 -1
Dockerfile CHANGED
@@ -4,6 +4,7 @@ FROM ubuntu:22.04
4
  # Set environment variables
5
  ENV DEBIAN_FRONTEND=noninteractive
6
  ENV PYTHONUNBUFFERED=1
 
7
 
8
  # Install system dependencies
9
  RUN apt-get update && apt-get install -y \
@@ -25,9 +26,6 @@ RUN curl -fsSL https://ollama.com/install.sh | sh
25
  WORKDIR /app
26
 
27
  # Copy requirements first to leverage Docker cache
28
- COPY . /app/
29
-
30
-
31
  COPY requirements.txt .
32
 
33
  # Install Python dependencies
@@ -48,11 +46,11 @@ sleep 10\n\
48
  ollama pull mistral\n\
49
  \n\
50
  # Start FastAPI application\n\
51
- uvicorn main:app --host 0.0.0.0 --port 8000\n\
52
  ' > /app/start.sh && chmod +x /app/start.sh
53
 
54
  # Expose ports
55
  EXPOSE 8000 11434
56
 
57
  # Set the entrypoint
58
- ENTRYPOINT ["uvicorn", "main:app --port 8000 --reload"]
 
4
  # Set environment variables
5
  ENV DEBIAN_FRONTEND=noninteractive
6
  ENV PYTHONUNBUFFERED=1
7
+ ENV PYTHONPATH=/app
8
 
9
  # Install system dependencies
10
  RUN apt-get update && apt-get install -y \
 
26
  WORKDIR /app
27
 
28
  # Copy requirements first to leverage Docker cache
 
 
 
29
  COPY requirements.txt .
30
 
31
  # Install Python dependencies
 
46
  ollama pull mistral\n\
47
  \n\
48
  # Start FastAPI application\n\
49
+ cd /app && uvicorn main:app --host 0.0.0.0 --port 8000\n\
50
  ' > /app/start.sh && chmod +x /app/start.sh
51
 
52
  # Expose ports
53
  EXPOSE 8000 11434
54
 
55
  # Set the entrypoint
56
+ ENTRYPOINT ["/app/start.sh"]
main.py CHANGED
@@ -1,7 +1,7 @@
1
  from fastapi import FastAPI, HTTPException
2
  from pydantic import BaseModel
3
  from typing import Dict, Any, Optional
4
- from .final import AIAgent
5
 
6
  app = FastAPI(
7
  title="Healthcare AI Assistant",
 
1
  from fastapi import FastAPI, HTTPException
2
  from pydantic import BaseModel
3
  from typing import Dict, Any, Optional
4
+ from final import AIAgent
5
 
6
  app = FastAPI(
7
  title="Healthcare AI Assistant",