Sujith2121 commited on
Commit
3f9cdcb
·
verified ·
1 Parent(s): a7c9e82

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -2
Dockerfile CHANGED
@@ -1,10 +1,25 @@
 
1
  FROM python:3.10-slim
2
 
 
3
  WORKDIR /code
4
 
 
5
  COPY requirements.txt .
 
 
 
 
 
 
 
6
  RUN pip install --no-cache-dir -r requirements.txt
7
 
8
- COPY app.py .
 
 
 
 
9
 
10
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
+ # Use a lightweight Python base image
2
  FROM python:3.10-slim
3
 
4
+ # Set working directory
5
  WORKDIR /code
6
 
7
+ # Copy dependency list first (to use Docker cache efficiently)
8
  COPY requirements.txt .
9
+
10
+ # Install system dependencies and git (needed for CLIP)
11
+ RUN apt-get update && \
12
+ apt-get install -y git && \
13
+ rm -rf /var/lib/apt/lists/*
14
+
15
+ # Install Python dependencies
16
  RUN pip install --no-cache-dir -r requirements.txt
17
 
18
+ # Copy all project files into the container
19
+ COPY . .
20
+
21
+ # Expose the port Hugging Face Spaces uses
22
+ EXPOSE 7860
23
 
24
+ # Command to run the FastAPI app
25
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]