Kaballas's picture
eee
b34e545
raw
history blame
1.37 kB
FROM python:3.10-slim
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
python3-dev \
openssl \
curl \
ca-certificates \
gnupg \
build-essential && \
rm -rf /var/lib/apt/lists/*
# Set up MariaDB's Python connector dependencies
RUN curl -LsSO https://r.mariadb.com/downloads/mariadb_repo_setup && \
echo "c4a0f3dade02c51a6a28ca3609a13d7a0f8910cccbb90935a2f218454d3a914a mariadb_repo_setup" | sha256sum -c - && \
chmod +x mariadb_repo_setup && \
./mariadb_repo_setup --mariadb-server-version="mariadb-11.7" && \
rm mariadb_repo_setup && \
apt-get update && \
apt-get install -y --no-install-recommends \
libmariadb3 \
libmariadb-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install uv package manager
RUN pip install --no-cache-dir uv
WORKDIR /app
# Use /tmp for cache to avoid permission issues
ENV UV_CACHE_DIR=/tmp/uvcache
RUN mkdir -p ${UV_CACHE_DIR} && chmod -R 777 ${UV_CACHE_DIR}
# Copy project files
COPY . /app
# Install project dependencies and clean git cache
RUN uv sync && rm -rf ${UV_CACHE_DIR}/git-v0 || true
# Hugging Face Spaces expects your app to listen on $PORT
EXPOSE 7860
ENV PORT=7860
# Run the app
CMD ["sh", "-c", "uv run mcp-server-mariadb-vector --transport sse --host 0.0.0.0 --port $PORT"]