CoolFace
Apppublic

Mukda/my-first-ml-api

sourceHugging Facemitupdated 1y agoView on Hugging Face
0likes
Dockerfile22 linesDownload Raw Back to root
1 2# 1. ใช้ base image ของ Python 3.93FROM python:3.9-slim4 5# 2. ตั้งค่า working directory ใน container6WORKDIR /code7 8# 3. คัดลอกไฟล์ requirements.txt เข้าไปก่อน9COPY ./requirements.txt /code/requirements.txt10 11# 4. ติดตั้ง dependencies จากไฟล์ requirements.txt12RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt13 14# 5. คัดลอกไฟล์โค้ดและโมเดลทั้งหมดเข้าไป15COPY . /code/16 17# 6. บอกให้ Container เปิด Port 80 รอรับการเชื่อมต่อ18EXPOSE 8019 20# 7. คำสั่งสำหรับรันแอปพลิเคชันของเรา  ใช้ PORT  7860  ซึ่งเป็น defaul port ของ Hugging face Space21CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]22