mahmoudsaber0 commited on
Commit
52e0867
·
verified ·
1 Parent(s): dde6bd9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -7
Dockerfile CHANGED
@@ -1,14 +1,28 @@
 
1
  FROM python:3.10-slim
2
 
 
3
  WORKDIR /app
4
 
5
- COPY requirements.txt .
6
- RUN pip install --no-cache-dir -r requirements.txt
 
 
 
 
 
7
 
8
- # ✅ Create a writable cache folder
9
- RUN mkdir -p /tmp/huggingface && chmod -R 777 /tmp/huggingface
 
 
 
 
 
10
 
11
- COPY . .
 
 
12
 
13
- EXPOSE 7860
14
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # ✅ Base image
2
  FROM python:3.10-slim
3
 
4
+ # ✅ Set working directory
5
  WORKDIR /app
6
 
7
+ # Environment variables
8
+ ENV PYTHONUNBUFFERED=1 \
9
+ PYTHONDONTWRITEBYTECODE=1 \
10
+ HF_HOME=/tmp/huggingface \
11
+ TRANSFORMERS_CACHE=/tmp/huggingface \
12
+ HF_DATASETS_CACHE=/tmp/huggingface \
13
+ HF_HUB_CACHE=/tmp/huggingface
14
 
15
+ # ✅ Install system dependencies
16
+ RUN apt-get update && apt-get install -y --no-install-recommends \
17
+ build-essential \
18
+ ffmpeg \
19
+ git \
20
+ curl \
21
+ && rm -rf /var/lib/apt/lists/*
22
 
23
+ # Install Python dependencies
24
+ COPY requirements.txt .
25
+ RUN pip install --no-cache-dir -r requirements.txt
26
 
27
+ # ✅ Create writable cache folder
28
+ RUN mkdir -p /tmp/hu