File size: 750 Bytes
9a9156e
 
2e8b534
9a9156e
 
adcc516
9a9156e
 
 
 
2e8b534
9a9156e
 
adcc516
9a9156e
 
2e8b534
 
9a9156e
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Use a Python base image, preferably a slim version for smaller image size
FROM python:3.10-slim-buster

# Set the working directory inside the container
WORKDIR /app

# Copy the requirements file and install Python dependencies
# Using --no-cache-dir for smaller image size during pip install
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy your MCP server script into the container
COPY app.py .

# Expose the port your application will listen on.
# Hugging Face Spaces typically routes traffic to port 7860.
EXPOSE 7860

# Command to run your MCP server when the container starts
# The `python -u` flag ensures unbuffered stdout, which is good for real-time logging in containers.
CMD ["python", "-u", "app.py"]