FROM python:3.12-slim

WORKDIR /app

# Cài các thư viện cần thiết cho sentence-transformers, sau đó xóa cache để giảm size
RUN apt-get update && \
    apt-get install -y --no-install-recommends gcc g++ && \
    rm -rf /var/lib/apt/lists/*

# Cài Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy toàn bộ mã nguồn (nên dùng .dockerignore để loại trừ file không cần thiết)
COPY . .

# Expose port cho FastAPI HTTP
EXPOSE 8090

# Lệnh chạy server FastAPI
CMD ["python3.12", "-m", "uvicorn", "memory_mcp_server:app", "--host", "0.0.0.0", "--port", "8090"]