Spaces:
Sleeping
Sleeping
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"] |