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