Tantawi commited on
Commit
20ff104
·
verified ·
1 Parent(s): 1239ef5

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -6
Dockerfile CHANGED
@@ -1,18 +1,21 @@
1
  # Use a CPU-based Python image compatible with Hugging Face
2
  FROM python:3.8-slim
3
 
4
- # Set working directory
5
  WORKDIR /app
6
 
7
- # Copy and install dependencies
8
  COPY requirements.txt .
9
  RUN pip install --no-cache-dir -r requirements.txt
10
 
11
- # Copy your app
 
 
 
12
  COPY app/ ./app/
13
 
14
- # Expose the default port
15
  EXPOSE 7860
16
 
17
- # Run FastAPI with Uvicorn
18
- CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  # Use a CPU-based Python image compatible with Hugging Face
2
  FROM python:3.8-slim
3
 
4
+ # Set the working directory
5
  WORKDIR /app
6
 
7
+ # Copy requirements and install dependencies
8
  COPY requirements.txt .
9
  RUN pip install --no-cache-dir -r requirements.txt
10
 
11
+ # Manually install TensorFlow CPU version
12
+ RUN pip install --no-cache-dir tensorflow==2.10.0
13
+
14
+ # Copy the FastAPI application
15
  COPY app/ ./app/
16
 
17
+ # Expose the port (Hugging Face expects 7860)
18
  EXPOSE 7860
19
 
20
+ # Run the FastAPI app
21
+ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]