emotion / Dockerfile
ducdatit2002's picture
Upload folder using huggingface_hub
82df4a4 verified
raw
history blame contribute delete
761 Bytes
# Sử dụng image Python 3.9 slim làm base image
FROM python:3.9-slim
# Thiết lập thư mục làm việc
WORKDIR /app
# Cài đặt các gói hệ thống cần thiết
RUN apt-get update && apt-get install -y \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Copy file requirements.txt vào container
COPY requirements.txt .
# Nâng cấp pip và cài đặt các thư viện Python từ requirements.txt
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
# Copy toàn bộ mã nguồn vào container (bao gồm cả thư mục checkpoint)
COPY . .
# Expose cổng mà API sẽ chạy
EXPOSE 8000
# Khởi chạy ứng dụng với uvicorn
CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "8000"]