junaid17 commited on
Commit
7ae4514
·
verified ·
1 Parent(s): da6e212

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -8
Dockerfile CHANGED
@@ -1,27 +1,25 @@
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
  ENV PYTHONDONTWRITEBYTECODE=1
4
  ENV PYTHONUNBUFFERED=1
5
 
6
  WORKDIR /app
7
 
8
+ # System deps for sklearn / xgboost / numpy
9
  RUN apt-get update && apt-get install -y \
10
  build-essential \
11
  gcc \
12
+ libgomp1 \
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
+ # Install Python deps
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 app
21
  COPY . .
22
 
 
23
  EXPOSE 7860
24
 
25
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]