Hamza4100 commited on
Commit
e57f607
·
verified ·
1 Parent(s): 50db433

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -12
Dockerfile CHANGED
@@ -2,26 +2,20 @@ FROM python:3.10-slim
2
 
3
  WORKDIR /app
4
 
5
- # Environment fix for Python package detection
6
  ENV PYTHONPATH=/app
7
 
8
- # Install system dependencies (important for HF spaces)
9
  RUN apt-get update && apt-get install -y gcc
10
 
11
- # Copy requirements first (cache optimization)
12
- COPY requirements.txt .
13
 
14
  # Install Python dependencies
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
17
- # Copy project code
18
- COPY . .
19
-
20
- # Create uploads directory
21
  RUN mkdir -p /app/uploads
22
 
23
- # Expose port (HF Spaces uses this internally)
24
- EXPOSE 7860
25
-
26
- # Run FastAPI app (HF Spaces friendly)
27
  CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
2
 
3
  WORKDIR /app
4
 
5
+ # Fix Python package path for HF Spaces
6
  ENV PYTHONPATH=/app
7
 
8
+ # Install system dependencies (HF Spaces needs this sometimes)
9
  RUN apt-get update && apt-get install -y gcc
10
 
11
+ # Copy project files
12
+ COPY . .
13
 
14
  # Install Python dependencies
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
17
+ # Create uploads folder
 
 
 
18
  RUN mkdir -p /app/uploads
19
 
20
+ # Run FastAPI app
 
 
 
21
  CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]