Spaces:
Sleeping
Sleeping
File size: 635 Bytes
bd3a9de |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# Standart bir Python 3.10 imajı kullan
FROM python:3.10-slim
# Konteyner içinde /code adında bir klasör oluştur ve oraya geç
WORKDIR /code
# Önce requirements.txt dosyasını kopyala ve kütüphaneleri kur
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Şimdi app.py kodunu kopyala
COPY ./app.py /code/app.py
# Hugging Face'in dışarıdan erişim için beklediği port
EXPOSE 7860
# Uygulamayı FastAPI sunucusu (uvicorn) ile başlat
# 0.0.0.0 adresi ve 7860 portu üzerinden yayın yap
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |