Princeaka commited on
Commit
ffd5b68
·
verified ·
1 Parent(s): e3e429a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -14
Dockerfile CHANGED
@@ -1,7 +1,11 @@
1
  FROM python:3.10-bullseye
2
 
3
- # Avoid interactive prompts during apt installs
4
- ENV DEBIAN_FRONTEND=noninteractive
 
 
 
 
5
 
6
  # --- Install system dependencies ---
7
  RUN apt-get update && apt-get install -y \
@@ -19,23 +23,23 @@ RUN apt-get update && apt-get install -y \
19
  && rm -rf /var/lib/apt/lists/* \
20
  && git lfs install
21
 
22
- # --- Copy requirements and install Python dependencies ---
 
 
 
23
  COPY requirements.txt /app/requirements.txt
24
- RUN pip install --no-cache-dir --upgrade pip && \
25
- pip install --no-cache-dir -r /app/requirements.txt
 
 
26
 
27
  # --- Copy application code ---
28
  WORKDIR /app
29
  COPY . /app
30
 
31
- # --- Environment variables for HF + Transformers ---
32
- ENV HF_HUB_DISABLE_TELEMETRY=1 \
33
- HF_HUB_ENABLE_HF_TRANSFER=1 \
34
- TOKENIZERS_PARALLELISM=false
35
 
36
- # --- Expose default Gradio port ---
37
  EXPOSE 7860
38
- # Create model_cache and tmp with proper ownership
39
- RUN mkdir -p /app/model_cache /app/tmp && chown -R 1000:1000 /app
40
- # --- Run app ---
41
- CMD ["python", "app.py"]
 
1
  FROM python:3.10-bullseye
2
 
3
+ ENV DEBIAN_FRONTEND=noninteractive \
4
+ HF_HUB_DISABLE_TELEMETRY=1 \
5
+ HF_HUB_ENABLE_HF_TRANSFER=1 \
6
+ TOKENIZERS_PARALLELISM=false \
7
+ PIP_DISABLE_PIP_VERSION_CHECK=1 \
8
+ PIP_NO_CACHE_DIR=1
9
 
10
  # --- Install system dependencies ---
11
  RUN apt-get update && apt-get install -y \
 
23
  && rm -rf /var/lib/apt/lists/* \
24
  && git lfs install
25
 
26
+ # --- Install Python build tools early for speed ---
27
+ RUN pip install --upgrade pip setuptools wheel
28
+
29
+ # --- Copy only requirements first for better caching ---
30
  COPY requirements.txt /app/requirements.txt
31
+
32
+ # Install dependencies with faster resolution
33
+ RUN pip install --upgrade pip \
34
+ && pip install --prefer-binary --use-deprecated=legacy-resolver -r /app/requirements.txt
35
 
36
  # --- Copy application code ---
37
  WORKDIR /app
38
  COPY . /app
39
 
40
+ # Create writable directories
41
+ RUN mkdir -p /app/model_cache /app/tmp && chown -R 1000:1000 /app
 
 
42
 
 
43
  EXPOSE 7860
44
+
45
+ CMD ["python", "app.py"]