Spaces:
Sleeping
Sleeping
apple muncy
commited on
Commit
·
b6b947d
1
Parent(s):
c323042
revert to Dockerfile with edits
Browse filesSigned-off-by: apple muncy <[email protected]>
- Dockerfile +32 -0
- pyproject.toml +24 -0
- requirements.txt +2 -2
Dockerfile
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.11-slim
|
2 |
+
|
3 |
+
# Set working directory
|
4 |
+
WORKDIR /app
|
5 |
+
|
6 |
+
# Install system dependencies
|
7 |
+
RUN apt-get update && apt-get install -y \
|
8 |
+
git \
|
9 |
+
&& rm -rf /var/lib/apt/lists/*
|
10 |
+
|
11 |
+
# Copy project files
|
12 |
+
COPY pyproject.toml .
|
13 |
+
COPY app.py .
|
14 |
+
COPY mcp_server.py .
|
15 |
+
COPY README.md .
|
16 |
+
|
17 |
+
# Install Python dependencies
|
18 |
+
RUN pip install --no-cache-dir -e .
|
19 |
+
|
20 |
+
# Create a non-root user
|
21 |
+
RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app
|
22 |
+
USER appuser
|
23 |
+
|
24 |
+
# Expose port
|
25 |
+
EXPOSE 8000
|
26 |
+
|
27 |
+
# Health check
|
28 |
+
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
29 |
+
CMD curl -f http://localhost:8000/ || exit 1
|
30 |
+
|
31 |
+
# Run the application
|
32 |
+
CMD ["python", "app.py"]
|
pyproject.toml
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[project]
|
2 |
+
name = "mcp-course-unit3-example"
|
3 |
+
version = "0.1.0"
|
4 |
+
description = "FastAPI and Gradio app for Hugging Face Hub discussion webhooks"
|
5 |
+
readme = "README.md"
|
6 |
+
requires-python = ">=3.11"
|
7 |
+
dependencies = [
|
8 |
+
"fastapi>=0.104.0",
|
9 |
+
"uvicorn[standard]>=0.24.0",
|
10 |
+
"gradio>=4.0.0",
|
11 |
+
"huggingface-hub[mcp]>=0.32.0",
|
12 |
+
"pydantic>=2.0.0",
|
13 |
+
"python-multipart>=0.0.6",
|
14 |
+
"requests>=2.31.0",
|
15 |
+
"python-dotenv>=1.0.0",
|
16 |
+
"fastmcp>=2.0.0",
|
17 |
+
]
|
18 |
+
|
19 |
+
[build-system]
|
20 |
+
requires = ["hatchling"]
|
21 |
+
build-backend = "hatchling.build"
|
22 |
+
|
23 |
+
[tool.hatch.build.targets.wheel]
|
24 |
+
packages = ["src"]
|
requirements.txt
CHANGED
@@ -19,8 +19,8 @@ ffmpy==0.5.0
|
|
19 |
filelock==3.18.0
|
20 |
frozenlist==1.6.0
|
21 |
fsspec==2025.5.1
|
22 |
-
gradio
|
23 |
-
gradio-client
|
24 |
groovy==0.1.2
|
25 |
h11==0.16.0
|
26 |
hf-xet==1.1.2 ; platform_machine == 'aarch64' or platform_machine == 'amd64' or platform_machine == 'arm64' or platform_machine == 'x86_64'
|
|
|
19 |
filelock==3.18.0
|
20 |
frozenlist==1.6.0
|
21 |
fsspec==2025.5.1
|
22 |
+
gradio==5.31.0
|
23 |
+
gradio-client==1.10.1
|
24 |
groovy==0.1.2
|
25 |
h11==0.16.0
|
26 |
hf-xet==1.1.2 ; platform_machine == 'aarch64' or platform_machine == 'amd64' or platform_machine == 'arm64' or platform_machine == 'x86_64'
|