Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: support docker-compose #97

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ ENV OPENAI_API_KEY=${OPENAI_API_KEY}
ARG BING_API_KEY
ENV BING_API_KEY=${BING_API_KEY}

# 设置环境变量
# Setting environment variables
ENV PATH=/opt/conda/bin:$PATH

# 克隆git仓库
# Cloning the git repository
RUN git clone https://github.com/InternLM/MindSearch.git /app

WORKDIR /app

# 创建并激活 fastapi 环境,并安装依赖包
# Create and activate the fastapi environment and install dependencies
RUN conda create --name fastapi python=3.10 -y && \
conda run -n fastapi pip install -r requirements.txt && \
conda clean --all -f -y

# 暴露 FastAPI 默认端口
EXPOSE 8000
# Exposing the FastAPI Default Port
EXPOSE 8002

# 启动 FastAPI 服务
CMD ["conda", "run", "--no-capture-output", "-n", "fastapi", "uvicorn", "mindsearch.app:app", "--host", "0.0.0.0", "--port", "8002"]
# Setting up the entry point
ENTRYPOINT ["/bin/bash", "-c", "source /opt/conda/etc/profile.d/conda.sh && conda activate fastapi && python -m mindsearch.app \"$@\" && exec uvicorn mindsearch.app:app --host 0.0.0.0 --port 8002"]
16 changes: 16 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: '3.3'

services:
mindsearch-bc:
build: .
# image: mindsearch:latest
ports:
- "8002:8002"
environment:
- OPENAI_API_KEY=your_openai_api_key_here
- QWEN_API_KEY=your_qwen_api_key_here
- BING_API_KEY=your_bing_api_key_here
command: [
"--lang=cn",
"--model_format=internlm_server"
]