Aayan873 commited on
Commit
22c683c
·
verified ·
1 Parent(s): 52b38e7

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -10
Dockerfile CHANGED
@@ -1,8 +1,9 @@
1
  FROM python:3.10-slim
2
  WORKDIR /app
3
- ENV PYTHONUNBUFFERED=1
4
 
5
- RUN apt-get update && apt-get install -y \
 
6
  ffmpeg \
7
  libgl1-mesa-glx \
8
  libsm6 \
@@ -10,20 +11,23 @@ RUN apt-get update && apt-get install -y \
10
  libxrender-dev \
11
  libglib2.0-0 \
12
  git \
13
- && rm -rf /var/lib/apt/lists/*
 
 
 
 
 
14
 
 
15
  COPY requirements.txt /app/requirements.txt
16
- RUN pip install --no-cache-dir -r requirements.txt
17
 
 
18
  COPY . /app
19
 
20
- ENV HF_HOME=/tmp/hf \
21
- TRANSFORMERS_CACHE=/tmp/hf/transformers \
22
- SENTENCE_TRANSFORMERS_HOME=/tmp/hf/sentence-transformers \
23
- XDG_CACHE_HOME=/tmp
24
 
25
  EXPOSE 7860
26
-
27
  HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health || exit 1
28
-
29
  CMD ["streamlit","run","app.py","--server.port=7860","--server.address=0.0.0.0","--browser.gatherUsageStats=false"]
 
1
  FROM python:3.10-slim
2
  WORKDIR /app
3
+ ENV PYTHONUNBUFFERED=1 PIP_DISABLE_PIP_VERSION_CHECK=1 PIP_NO_CACHE_DIR=1
4
 
5
+ # OS deps for Whisper/EasyOCR + curl for healthcheck
6
+ RUN apt-get update && apt-get install -y --no-install-recommends \
7
  ffmpeg \
8
  libgl1-mesa-glx \
9
  libsm6 \
 
11
  libxrender-dev \
12
  libglib2.0-0 \
13
  git \
14
+ curl \
15
+ build-essential \
16
+ libopenblas-dev \
17
+ && rm -rf /var/lib/apt/lists/* # keep image small
18
+ # Upgrade build tooling before installing Python deps
19
+ RUN python -m pip install --upgrade pip setuptools wheel # more robust builds
20
 
21
+ # Python deps (root-level requirements.txt)
22
  COPY requirements.txt /app/requirements.txt
23
+ RUN pip install --no-cache-dir -r requirements.txt # install app deps
24
 
25
+ # Copy all app code at repo root (no src/ in your tree)
26
  COPY . /app
27
 
28
+ # (Optional) route HF caches to writable /tmp
29
+ ENV HF_HOME=/tmp/hf TRANSFORMERS_CACHE=/tmp/hf/transformers SENTENCE_TRANSFORMERS_HOME=/tmp/hf/sentence-transformers XDG_CACHE_HOME=/tmp
 
 
30
 
31
  EXPOSE 7860
 
32
  HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health || exit 1
 
33
  CMD ["streamlit","run","app.py","--server.port=7860","--server.address=0.0.0.0","--browser.gatherUsageStats=false"]