Spaces:
Running
Running
File size: 840 Bytes
f638aca a6d5c6e |
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 33 34 |
FROM python:3.12
# Install uv for fast Python package management
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/
# HuggingFace Spaces requires user with ID 1000
RUN useradd -m -u 1000 user
USER user
# Environment setup
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH \
PYTHONPATH=/home/user/app
WORKDIR $HOME/app
# Copy Python project configuration
COPY --chown=user pyproject.toml uv.lock* ./
# Install dependencies using uv (much faster than pip)
RUN uv sync --frozen --no-cache
# Copy the entire project (respects .dockerignore)
COPY --chown=user . .
# Expose HuggingFace Spaces port
EXPOSE 7860
# Add a verbose startup script for clearer runtime logs
COPY --chown=user scripts/start.sh ./start.sh
RUN chmod +x ./start.sh
# Start the MCP server via the debug-friendly script
CMD ["./start.sh"] |