Open leochen-g opened 3 months ago
不知能不能提供一个docker来使用,或者提供一下使用文档,非常感激
我给你来一个 dockerfile
FROM python:3.11-slim
RUN pip install poetry -i https://mirrors.aliyun.com/pypi/simple
WORKDIR /app
COPY . .
RUN poetry install
CMD ["poetry", "run", "uvicorn", "app:app", "--reload", "--port","8000", "--host", "0.0.0.0"]
再来一个 docker-compose.yaml
version: '3'
services:
app:
build: .
container_name: app
ports:
- "8000:8000"
environment:
- POETRY_VIRTUALENVS_CREATE=always
- OPENAI_BASE_URL=${OPENAI_BASE_URL}
- OPENAI_API_KEY=${OPENAI_API_KEY}
- OPENAI_MODEL=${OPENAI_MODEL}
- OPENAI_EMBEDDING_MODEL=${OPENAI_EMBEDDING_MODEL}
- AUTH_KEY=${AUTH_KEY}
- VECTOR_STORE_PROVIDER=${VECTOR_STORE_PROVIDER}
# The name of the collection to store the vectors, default is mem0
- VECTOR_STORE_COLLECTION_NAME=${VECTOR_STORE_COLLECTION_NAME}
# The host where the vector server is running
- VECTOR_STORE_SERVER_HOST=${VECTOR_STORE_SERVER_HOST}
# The port where the vector server is running
- VECTOR_STORE_SERVER_PORT=${VECTOR_STORE_SERVER_PORT}
# Path for the qdrant database, default is `/tmp/qdrant`
- VECTOR_STORE_QDRANT_PATH=${VECTOR_STORE_QDRANT_PATH}
- VECTOR_STORE_QDRANT_ON_DISK=${VECTOR_STORE_QDRANT_ON_DISK}
# API key for the qdrant server
- VECTOR_STORE_QDRANT_API_KEY=${VECTOR_STORE_QDRANT_API_KEY}
# Dimensions of the embedding model
- VECTOR_STORE_EMBEDDING_MODEL_DIMS=${VECTOR_STORE_EMBEDDING_MODEL_DIMS}
depends_on:
- qdrant
command: poetry run uvicorn app:app --reload --host 0.0.0.0 --port 8000
qdrant:
image: qdrant/qdrant
container_name: qdrant
restart: always
ports:
- "6333:6333"
- "6334:6334"
expose:
- 6333
- 6334
- 6335
volumes:
- ./qdrant_data:/qdrant/storage
configs:
- source: qdrant_config
target: /qdrant/config/production.yaml
configs:
qdrant_config:
content: |
log_level: INFO
依赖里 少了 uvicorn
,加上就好了
不知能不能提供一个docker来使用,或者提供一下使用文档,非常感激