-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (26 loc) · 786 Bytes
/
Dockerfile
File metadata and controls
32 lines (26 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
FROM python:3.10-slim
# install llama-cpp-python dependency
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
libopenblas-dev \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy only necessary files first
COPY setup.py README.md requirements.txt requirements.in ./
# Copy actual source code
COPY src/ src/
# Copy source code related to fastapi
COPY app/ app/
# Copy vector_db
COPY vector_db/ vector_db/
# Environment variable to trigger auto-download
ENV AUTO_DOWNLOAD_MODEL=true
ENV UPDATE_KNOWLEDGE_BASE=false
# Install dependencies
RUN pip install --upgrade pip && \
pip install pip-tools && \
pip install -r requirements.txt
# 修改 CMD
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]