junaid17 commited on
Commit
08762aa
·
verified ·
1 Parent(s): 84ef2a8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -27
Dockerfile CHANGED
@@ -1,27 +1,14 @@
1
- FROM python:3.10-slim
2
-
3
- # Prevent Python from writing pyc files
4
- ENV PYTHONDONTWRITEBYTECODE=1
5
- ENV PYTHONUNBUFFERED=1
6
-
7
- WORKDIR /app
8
-
9
- # Install system dependencies (required for sklearn / xgboost)
10
- RUN apt-get update && apt-get install -y \
11
- build-essential \
12
- gcc \
13
- && rm -rf /var/lib/apt/lists/*
14
-
15
- # Copy and install dependencies first (better caching)
16
- COPY requirements.txt .
17
- RUN pip install --no-cache-dir --upgrade pip \
18
- && pip install --no-cache-dir -r requirements.txt
19
-
20
- # Copy application code
21
- COPY . .
22
-
23
- # Hugging Face expects port 7860
24
- EXPOSE 7860
25
-
26
- # Start FastAPI
27
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ FROM python:3.9-slim
2
+
3
+ WORKDIR /app
4
+
5
+ RUN apt-get update && apt-get install -y \
6
+ libgl1 libgomp1 \
7
+ && rm -rf /var/lib/apt/lists/*
8
+
9
+ COPY requirements.txt .
10
+ RUN pip install --no-cache-dir -r requirements.txt
11
+
12
+ COPY . .
13
+
14
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]