victor-johnson commited on
Commit
ad0b123
·
verified ·
1 Parent(s): 11c0784

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -1
Dockerfile CHANGED
@@ -1,12 +1,23 @@
 
1
  FROM python:3.10-slim
 
 
2
  WORKDIR /app
3
 
 
 
 
 
 
 
4
  COPY requirements.txt .
5
  RUN pip install --no-cache-dir -r requirements.txt
6
 
 
7
  COPY . .
8
 
9
- # expose for clarity (not strictly needed)
10
  EXPOSE 7860
11
 
 
12
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Use a minimal Python base image
2
  FROM python:3.10-slim
3
+
4
+ # Set working directory
5
  WORKDIR /app
6
 
7
+ # Install git (needed for pip install from GitHub)
8
+ RUN apt-get update && \
9
+ apt-get install -y git && \
10
+ rm -rf /var/lib/apt/lists/*
11
+
12
+ # Copy and install Python dependencies
13
  COPY requirements.txt .
14
  RUN pip install --no-cache-dir -r requirements.txt
15
 
16
+ # Copy application code
17
  COPY . .
18
 
19
+ # Expose the port Spaces uses
20
  EXPOSE 7860
21
 
22
+ # Start the FastAPI app with Uvicorn
23
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]