programci48 commited on
Commit
8a769a3
·
verified ·
1 Parent(s): 0f3580d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -4
Dockerfile CHANGED
@@ -4,8 +4,8 @@ FROM python:3.10-slim
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
@@ -19,7 +19,11 @@ 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"]
 
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 /tmp/offload && \
8
+ chmod 777 /tmp/huggingface /tmp/offload
9
 
10
  # Çalışma dizini ve ortam değişkenleri
11
  WORKDIR /app
 
19
 
20
  # Bağımlılıkları yükle
21
  RUN pip install --no-cache-dir -r requirements.txt && \
22
+ if [ "$(uname -m)" = "x86_64" ]; then \
23
+ pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu; \
24
+ else \
25
+ pip install --no-cache-dir torch; \
26
+ fi
27
 
28
  # Çalıştırma komutu
29
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]