Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +14 -0
Dockerfile
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ใช้ Python 3.9
|
| 2 |
+
FROM python:3.9
|
| 3 |
+
|
| 4 |
+
# ติดตั้ง dependencies
|
| 5 |
+
RUN pip install --no-cache-dir fastapi uvicorn transformers torch
|
| 6 |
+
|
| 7 |
+
# คัดลอกไฟล์โค้ดทั้งหมดไปยัง container
|
| 8 |
+
COPY app.py /app.py
|
| 9 |
+
|
| 10 |
+
# เปิดพอร์ต 7860 (ที่ HF Spaces ใช้)
|
| 11 |
+
EXPOSE 7860
|
| 12 |
+
|
| 13 |
+
# รัน FastAPI ด้วย Uvicorn
|
| 14 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|