Varshith dharmaj commited on
Commit
f4792b1
·
verified ·
1 Parent(s): 8d78930

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +26 -30
Dockerfile CHANGED
@@ -1,30 +1,26 @@
1
- # Use official Python runtime as a parent image
2
- FROM python:3.10-slim
3
-
4
- # Set working directory
5
- WORKDIR /app
6
-
7
- # Install system dependencies (needed for OpenCV and Tesseract)
8
- RUN apt-get update && apt-get install -y \
9
- tesseract-ocr \
10
- libgl1-mesa-glx \
11
- && rm -rf /var/lib/apt/lists/*
12
-
13
- # Copy requirements (if exists, else handle dynamically? For now we assume user has one or we create it)
14
- # We will create a requirements.txt in the next step, so this command assumes it exists.
15
- COPY requirements.txt .
16
-
17
- # Install Python packages
18
- RUN pip install --no-cache-dir -r requirements.txt
19
-
20
- # Copy the backend code
21
- COPY backend/ ./backend/
22
-
23
- # Expose port
24
- EXPOSE 8000
25
-
26
- # Define environment variables
27
- ENV PYTHONPATH=/app
28
-
29
- # Run the application
30
- CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "8000"]
 
1
+ FROM python:3.11-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Install system dependencies
6
+ RUN apt-get update && apt-get install -y \
7
+ build-essential \
8
+ curl \
9
+ && rm -rf /var/lib/apt/lists/*
10
+
11
+ # Copy requirements and install Python packages
12
+ COPY requirements.txt .
13
+ RUN pip install --no-cache-dir -r requirements.txt
14
+
15
+ # Copy project files
16
+ COPY . .
17
+
18
+ # Expose Streamlit port (HF Spaces uses 7860)
19
+ EXPOSE 7860
20
+
21
+ # HF Spaces needs the app to run on 0.0.0.0:7860
22
+ CMD ["streamlit", "run", "services/dashboard/app.py", \
23
+ "--server.port=7860", \
24
+ "--server.address=0.0.0.0", \
25
+ "--server.headless=true", \
26
+ "--browser.gatherUsageStats=false"]