ciyidogan commited on
Commit
09fc2d1
·
verified ·
1 Parent(s): 657ac69

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -14
Dockerfile CHANGED
@@ -1,23 +1,25 @@
 
1
  FROM python:3.10-slim
2
 
3
- # Hugging Face Spaces özel dizinleri
4
- RUN mkdir -p /app /model && chmod -R 777 /app /model
5
  WORKDIR /app
6
 
7
- # Triton cache için dizin yarat
8
- RUN mkdir -p /tmp/.triton && chmod -R 777 /tmp/.triton
 
9
 
10
- # Ortam değişkeni tanımla
11
- ENV TRITON_CACHE_DIR=/tmp/.triton
12
 
13
- # Sistem bağımlılıkları
14
- RUN apt-get update && apt-get install -y git build-essential cmake
 
 
15
 
16
- # Python bağımlılıkları (huggingface_hub eklendi!)
17
- RUN pip install --no-cache-dir llama-cpp-python[server] fastapi uvicorn huggingface_hub unsloth
18
 
19
- # Uygulama dosyasını kopyala
20
- COPY app.py /app/app.py
21
 
22
- # FastAPI sunucusunu başlat
23
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # === Temel Python imajı
2
  FROM python:3.10-slim
3
 
4
+ # === Çalışma dizini
 
5
  WORKDIR /app
6
 
7
+ # === Gerekli kütüphaneleri yükle
8
+ COPY requirements.txt .
9
+ RUN pip install --no-cache-dir -r requirements.txt
10
 
11
+ # === Hugging Face cache dizinleri ve izinleri
12
+ RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache
13
 
14
+ ENV HF_HOME=/app/.cache \
15
+ HF_DATASETS_CACHE=/app/.cache \
16
+ HF_HUB_CACHE=/app/.cache \
17
+ TRITON_CACHE_DIR=/tmp/.triton
18
 
19
+ RUN mkdir -p /tmp/.triton && chmod -R 777 /tmp/.triton
 
20
 
21
+ # === Uygulama dosyaları
22
+ COPY . .
23
 
24
+ # === Uygulama başlatma
25
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]