Spaces:
Sleeping
Sleeping
File size: 848 Bytes
2bd7cc7 be0f4a3 2bd7cc7 be0f4a3 | 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 | # Dockerfile for HTTP MCP Server (FastMCP)
# Optimized for HuggingFace Spaces (runs as non-root user, port 7860)
FROM python:3.12-slim
# Install dependencies as root into system Python
RUN pip install --no-cache-dir uv
COPY requirements.txt .
RUN UV_LINK_MODE=copy uv pip install --system --no-cache -r requirements.txt
# HuggingFace Spaces runs containers as a non-root user (UID 1000)
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1
WORKDIR $HOME/app
# Copy application
COPY --chown=user http_mcp_server.py .
# HuggingFace Spaces expects port 7860
EXPOSE 7860
# Environment variables (set these as HF Space Secrets):
# GOOGLE_CLIENT_ID
# GOOGLE_CLIENT_SECRET
# ALLOWED_EMAILS (comma-separated)
CMD ["python", "http_mcp_server.py"] |