Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +34 -0
Dockerfile
CHANGED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use Python base image
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
+
|
| 4 |
+
# Environment variables
|
| 5 |
+
ENV PYTHONDONTWRITEBYTECODE=1
|
| 6 |
+
ENV PYTHONUNBUFFERED=1
|
| 7 |
+
ENV PYTHONPATH=/app
|
| 8 |
+
|
| 9 |
+
# Install git and other system dependencies
|
| 10 |
+
RUN apt-get update && apt-get install -y \
|
| 11 |
+
git \
|
| 12 |
+
build-essential \
|
| 13 |
+
curl \
|
| 14 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
+
|
| 16 |
+
# Set working directory
|
| 17 |
+
WORKDIR /app
|
| 18 |
+
|
| 19 |
+
# Clone your GitHub repository directly
|
| 20 |
+
RUN git clone https://github.com/abubasith456/agent-mcp-server.git .
|
| 21 |
+
|
| 22 |
+
# Create and activate virtual environment
|
| 23 |
+
RUN python -m venv .venv
|
| 24 |
+
ENV PATH="/app/.venv/bin:$PATH"
|
| 25 |
+
|
| 26 |
+
# Upgrade pip and install dependencies
|
| 27 |
+
RUN .venv/bin/pip install --upgrade pip
|
| 28 |
+
RUN .venv/bin/pip install --no-cache-dir -r requirements.txt
|
| 29 |
+
|
| 30 |
+
# Expose port
|
| 31 |
+
EXPOSE 8000
|
| 32 |
+
|
| 33 |
+
# Run application with uvicorn
|
| 34 |
+
CMD ["/app/.venv/bin/uvicorn", "mcp_server:app", "--host", "0.0.0.0", "--port", "8000"]
|