mike23415 commited on
Commit
e140492
·
verified ·
1 Parent(s): 7949d53

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -16
Dockerfile CHANGED
@@ -1,29 +1,26 @@
1
- # Use official lightweight Python image
2
- FROM python:3.10-slim
3
 
4
- # Set environment variables
5
- ENV TRANSFORMERS_CACHE=/data/.cache \
6
- HF_HOME=/data/.cache \
7
- HUGGINGFACE_HUB_CACHE=/data/.cache \
8
- PYTHONUNBUFFERED=1
9
 
10
- # Install basic OS dependencies
11
  RUN apt-get update && apt-get install -y \
 
12
  git \
13
- libgl1-mesa-glx \
14
- libglib2.0-0 \
15
  && rm -rf /var/lib/apt/lists/*
16
 
17
- # Set working directory
18
- WORKDIR /app
 
19
 
20
- # Copy requirements and install
21
  COPY requirements.txt .
22
- RUN pip install --upgrade pip && pip install -r requirements.txt
23
 
24
- # Copy app code
25
  COPY app.py .
26
 
27
- # Expose the port and start the app
28
  EXPOSE 7860
 
 
29
  CMD ["python", "app.py"]
 
1
+ FROM python:3.9-slim
 
2
 
3
+ WORKDIR /app
 
 
 
 
4
 
5
+ # Install system dependencies
6
  RUN apt-get update && apt-get install -y \
7
+ build-essential \
8
  git \
 
 
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
+ # Create directory for cache
12
+ RUN mkdir -p /tmp/.cache/huggingface && \
13
+ chmod -R 777 /tmp/.cache
14
 
15
+ # Copy requirements and install dependencies
16
  COPY requirements.txt .
17
+ RUN pip install --no-cache-dir -r requirements.txt
18
 
19
+ # Copy application code
20
  COPY app.py .
21
 
22
+ # Expose the port
23
  EXPOSE 7860
24
+
25
+ # Command to run the application
26
  CMD ["python", "app.py"]