programci48 commited on
Commit
bc25ec1
·
verified ·
1 Parent(s): b845c7f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -4
Dockerfile CHANGED
@@ -1,12 +1,25 @@
1
  FROM python:3.10-slim
2
 
3
- RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
4
- RUN mkdir -p /tmp/huggingface && chmod 777 /tmp/huggingface
 
 
 
 
 
 
5
  WORKDIR /app
 
 
 
6
 
 
7
  COPY requirements.txt .
8
  COPY app.py .
9
 
10
- RUN pip install --no-cache-dir -r requirements.txt
 
 
11
 
12
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
  FROM python:3.10-slim
2
 
3
+ # Sistem bağımlılıkları ve temizlik
4
+ RUN apt-get update && \
5
+ apt-get install -y --no-install-recommends git gcc python3-dev && \
6
+ rm -rf /var/lib/apt/lists/* && \
7
+ mkdir -p /tmp/huggingface && \
8
+ chmod 777 /tmp/huggingface
9
+
10
+ # Çalışma dizini ve ortam değişkenleri
11
  WORKDIR /app
12
+ ENV HF_HOME=/tmp/huggingface \
13
+ TRANSFORMERS_CACHE=/tmp/huggingface \
14
+ PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:128
15
 
16
+ # Gerekli dosyaları kopyala
17
  COPY requirements.txt .
18
  COPY app.py .
19
 
20
+ # Bağımlılıkları yükle
21
+ RUN pip install --no-cache-dir -r requirements.txt && \
22
+ pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu
23
 
24
+ # Çalıştırma komutu
25
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]