um41r commited on
Commit
1864842
·
verified ·
1 Parent(s): 021e1f3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -10
Dockerfile CHANGED
@@ -2,7 +2,7 @@ FROM python:3.10-slim
2
 
3
  WORKDIR /app
4
 
5
- # Install system dependencies for OpenCV, pdf2docx, and poppler
6
  RUN apt-get update && apt-get install -y \
7
  build-essential \
8
  libgl1 \
@@ -16,21 +16,18 @@ RUN apt-get update && apt-get install -y \
16
  poppler-utils \
17
  && rm -rf /var/lib/apt/lists/*
18
 
19
- # Copy requirements and install Python dependencies
20
  COPY requirements.txt .
21
  RUN pip install --no-cache-dir -r requirements.txt
22
 
23
- # Copy application code
24
- COPY main.py .
25
 
26
- # Create temp directory
27
  RUN mkdir -p /tmp/conversions
28
 
29
- # Expose port
30
  EXPOSE 7860
31
-
32
- # Set environment variable for Hugging Face Spaces
33
  ENV PORT=7860
34
 
35
- # Run the application
36
- CMD ["python", "main.py"]
 
2
 
3
  WORKDIR /app
4
 
5
+ # Install system dependencies
6
  RUN apt-get update && apt-get install -y \
7
  build-essential \
8
  libgl1 \
 
16
  poppler-utils \
17
  && rm -rf /var/lib/apt/lists/*
18
 
19
+ # Install Python deps
20
  COPY requirements.txt .
21
  RUN pip install --no-cache-dir -r requirements.txt
22
 
23
+ # COPY ENTIRE PROJECT (THIS FIXES IT)
24
+ COPY . .
25
 
26
+ # Temp directory
27
  RUN mkdir -p /tmp/conversions
28
 
 
29
  EXPOSE 7860
 
 
30
  ENV PORT=7860
31
 
32
+ # Run with uvicorn (BEST PRACTICE)
33
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]