Rizwan9 commited on
Commit
ae521c0
·
verified ·
1 Parent(s): 5e9c81f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -12
Dockerfile CHANGED
@@ -1,29 +1,25 @@
1
- # ---- Base image ----
2
  FROM python:3.11-slim
3
 
4
- # ---- System deps (for numpy/scipy/sklearn) ----
5
  RUN apt-get update && apt-get install -y --no-install-recommends \
6
- build-essential \
7
- libatlas-base-dev \
8
- gfortran \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
- # ---- Workdir ----
12
  WORKDIR /app
13
 
14
- # ---- Install Python deps first (better caching) ----
15
  COPY requirements.txt /app/
16
  RUN pip install --no-cache-dir --upgrade pip \
17
  && pip install --no-cache-dir -r requirements.txt
18
 
19
- # ---- App code ----
20
  COPY . /app
21
 
22
- # ---- Port configuration ----
23
- # Hugging Face sets $PORT for you; default to 7860 for local dev
24
  ENV PORT=7860
25
  EXPOSE 7860
26
 
27
- # ---- Start server (bind to $PORT) ----
28
- # 1 worker + 2 threads is enough for CPU Spaces; adjust if needed
29
  CMD ["bash", "-lc", "gunicorn app:app --bind 0.0.0.0:${PORT} --workers 1 --threads 2 --timeout 120 --log-level info"]
 
 
1
  FROM python:3.11-slim
2
 
3
+ # Runtime libs for numpy/scipy/sklearn wheels on Debian trixie
4
  RUN apt-get update && apt-get install -y --no-install-recommends \
5
+ libgomp1 \
6
+ libgfortran5 \
7
+ libopenblas0 \
8
  && rm -rf /var/lib/apt/lists/*
9
 
 
10
  WORKDIR /app
11
 
12
+ # Install Python deps first for better caching
13
  COPY requirements.txt /app/
14
  RUN pip install --no-cache-dir --upgrade pip \
15
  && pip install --no-cache-dir -r requirements.txt
16
 
17
+ # Copy app code
18
  COPY . /app
19
 
20
+ # Hugging Face sets $PORT; default helps local dev
 
21
  ENV PORT=7860
22
  EXPOSE 7860
23
 
24
+ # Bind gunicorn to $PORT so Spaces health-checks pass
 
25
  CMD ["bash", "-lc", "gunicorn app:app --bind 0.0.0.0:${PORT} --workers 1 --threads 2 --timeout 120 --log-level info"]