24 lines
609 B
Docker
Executable File
24 lines
609 B
Docker
Executable File
FROM python:3.11-slim
|
|
|
|
# Cài đặt các system dependencies cần thiết cho OCR (PaddleOCR/OpenCV) và thao tác hệ thống
|
|
RUN apt-get update && apt-get install -y \
|
|
libgl1-mesa-glx \
|
|
libglib2.0-0 \
|
|
build-essential \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy requirements và cài đặt
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy toàn bộ source code
|
|
COPY . .
|
|
|
|
# Expose port cho FastAPI
|
|
EXPOSE 8000
|
|
|
|
# Chạy server FastAPI khi container khởi động
|
|
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
|