NinjainPJs commited on
Commit
e7cb7ca
·
1 Parent(s): 04fc1b0

Add Dockerfile for Hugging Face Spaces deployment

Browse files
Files changed (3) hide show
  1. Dockerfile +15 -0
  2. nixpacks.toml +1 -1
  3. requirements-prod.txt +33 -0
Dockerfile ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Install system dependencies for bandit/radon/ruff
6
+ RUN apt-get update && apt-get install -y --no-install-recommends gcc && rm -rf /var/lib/apt/lists/*
7
+
8
+ COPY requirements.txt .
9
+ RUN pip install --no-cache-dir -r requirements.txt
10
+
11
+ COPY . .
12
+
13
+ EXPOSE 7860
14
+
15
+ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
nixpacks.toml CHANGED
@@ -2,7 +2,7 @@
2
  nixPkgs = ["python311", "gcc"]
3
 
4
  [phases.install]
5
- cmds = ["pip install -r requirements.txt"]
6
 
7
  [start]
8
  cmd = "uvicorn app.main:app --host 0.0.0.0 --port ${PORT:-8000}"
 
2
  nixPkgs = ["python311", "gcc"]
3
 
4
  [phases.install]
5
+ cmds = ["pip install -r requirements-prod.txt"]
6
 
7
  [start]
8
  cmd = "uvicorn app.main:app --host 0.0.0.0 --port ${PORT:-8000}"
requirements-prod.txt ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Production dependencies (slim — excludes heavy ML packages for free tier hosting)
2
+ # sentence-transformers + torch are ~4GB, exceeding Railway/Render free tier image limits
3
+ # RAG context is disabled in production — agents work fine without it
4
+
5
+ # === Core Framework ===
6
+ fastapi>=0.115.0
7
+ uvicorn[standard]>=0.32.0
8
+ pydantic>=2.10.0
9
+ pydantic-settings>=2.6.0
10
+
11
+ # === LLM & Agents ===
12
+ langchain>=0.3.0
13
+ langchain-groq>=0.2.0
14
+
15
+ # === GitHub Integration ===
16
+ PyJWT[crypto]>=2.9.0
17
+ httpx>=0.28.0
18
+
19
+ # === Database ===
20
+ asyncpg>=0.30.0
21
+
22
+ # === Redis ===
23
+ redis>=5.2.0
24
+
25
+ # === Static Analysis Tools ===
26
+ bandit>=1.8.0
27
+ detect-secrets>=1.5.0
28
+ radon>=6.0.0
29
+ ruff>=0.8.0
30
+
31
+ # === Utilities ===
32
+ python-dotenv>=1.0.0
33
+ structlog>=24.4.0