Added cuda requirements
This commit is contained in:
parent
be19245259
commit
5dee11b68b
2 changed files with 33 additions and 4 deletions
|
|
@ -1,17 +1,39 @@
|
|||
FROM python:3.11-slim
|
||||
FROM nvidia/cuda:11.8.0-runtime-ubuntu22.04
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
||||
python3 \
|
||||
python3-pip \
|
||||
build-essential \
|
||||
git \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& ln -sf /usr/bin/python3 /usr/bin/python \
|
||||
&& ln -sf /usr/bin/pip3 /usr/bin/pip
|
||||
|
||||
COPY requirements/base.txt requirements/base.txt
|
||||
|
||||
RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \
|
||||
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
||||
python3-dev \
|
||||
libffi-dev \
|
||||
libssl-dev \
|
||||
cmake \
|
||||
pkg-config \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN pip install --no-cache-dir -r requirements/base.txt && \
|
||||
pip install --no-cache-dir mcp gpt4all sentence-transformers chromadb
|
||||
|
||||
RUN if [ ! -e /usr/lib/x86_64-linux-gnu/libcudart.so.11.0 ]; then \
|
||||
found=$(ls /usr/local/cuda/lib64/libcudart.so* 2>/dev/null | head -n1 || true); \
|
||||
if [ -n "$found" ]; then \
|
||||
mkdir -p /usr/lib/x86_64-linux-gnu || true; \
|
||||
ln -sf "$found" /usr/lib/x86_64-linux-gnu/libcudart.so.11.0 || true; \
|
||||
fi; \
|
||||
fi
|
||||
|
||||
COPY apps /app/apps
|
||||
COPY config /app/config
|
||||
COPY mcp_agent /app/mcp_agent
|
||||
|
|
|
|||
|
|
@ -24,16 +24,23 @@ services:
|
|||
deploy:
|
||||
mode: replicated
|
||||
replicas: 1
|
||||
resources:
|
||||
reservations:
|
||||
devices:
|
||||
- driver: nvidia
|
||||
count: all
|
||||
capabilities: [gpu]
|
||||
env_file:
|
||||
- ../../.env
|
||||
environment:
|
||||
- MCP_HTTP_HOST=0.0.0.0
|
||||
- MCP_HTTP_PORT=8001
|
||||
- NVIDIA_VISIBLE_DEVICES=all
|
||||
command: python -m mcp_agent.mcp_server
|
||||
volumes:
|
||||
- ../../:/app
|
||||
- ${USERPROFILE}/.cache/gpt4all:/root/.cache/gpt4all:rw
|
||||
- ../../build/rag_db:/app/build/rag_db:ro
|
||||
- ../../build/rag_db:/app/build/rag_db
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.fyp-mcp.rule=Host(`${MCP_DOMAIN}`)"
|
||||
|
|
|
|||
Loading…
Reference in a new issue