File size: 751 Bytes
db847c6
 
 
 
8723cac
a0c6302
3d571b8
 
db847c6
 
 
3d571b8
 
 
8723cac
3d571b8
8723cac
db847c6
 
 
a0c6302
 
 
db847c6
 
 
8723cac
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM python:3.10-slim

WORKDIR /app

# Önbellek dizini ve izinler
RUN mkdir -p /app/cache /app/templates && chmod -R 777 /app/cache

# Sistem bağımlılıkları
RUN apt-get update && apt-get install -y --no-install-recommends gcc && \

    apt-get clean && rm -rf /var/lib/apt/lists/*

# Ortam değişkenleri
ENV TRANSFORMERS_CACHE=/app/cache
ENV HF_HOME=/app/cache
ENV PYTHONUNBUFFERED=1

# Bağımlılıkları kur
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Uygulama dosyalarını kopyala
COPY app.py .
COPY templates/ templates/

EXPOSE 7860

# Production modunda çalıştır
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "1", "--threads", "2", "--timeout", "120", "app:app"]