Zeetay commited on
Commit
d96f0ad
·
1 Parent(s): b5816b6

feat: Hugging Face Spaces Docker deployment config

Browse files
Files changed (3) hide show
  1. .dockerignore +18 -0
  2. Dockerfile +30 -0
  3. README.md +9 -0
.dockerignore ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Secrets
2
+ .env
3
+
4
+ # Local databases & vector store (re-seeded at runtime)
5
+ agent.db
6
+ agent.db-wal
7
+ agent.db-shm
8
+ chroma_db/
9
+
10
+ # Python caches
11
+ __pycache__/
12
+ *.pyc
13
+
14
+ # Frontend (deployed separately to Vercel)
15
+ web/
16
+
17
+ # Git metadata
18
+ .git
Dockerfile ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Hugging Face Spaces (Docker SDK) image for the FastAPI backend.
2
+ # Spaces routes traffic to port 7860 by default.
3
+ FROM python:3.11-slim
4
+
5
+ # System libraries needed at runtime by torch (OpenMP via libgomp) and by
6
+ # chromadb/onnxruntime; ca-certificates for HTTPS model downloads.
7
+ RUN apt-get update \
8
+ && apt-get install -y --no-install-recommends \
9
+ libgomp1 \
10
+ ca-certificates \
11
+ && rm -rf /var/lib/apt/lists/*
12
+
13
+ # Use the PyTorch backend only; never import TensorFlow/Keras in transformers.
14
+ ENV USE_TF=0 \
15
+ USE_TORCH=1 \
16
+ PYTHONUNBUFFERED=1 \
17
+ PIP_NO_CACHE_DIR=1
18
+
19
+ WORKDIR /app
20
+
21
+ # Install Python deps first so this layer caches across code changes.
22
+ COPY requirements.txt ./
23
+ RUN pip install --upgrade pip && pip install -r requirements.txt
24
+
25
+ # Copy the rest of the project (the .dockerignore keeps secrets/db/web out).
26
+ COPY . .
27
+
28
+ EXPOSE 7860
29
+
30
+ CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "7860"]
README.md CHANGED
@@ -1,3 +1,12 @@
 
 
 
 
 
 
 
 
 
1
  # Self-Improving Ad Copy Agent
2
 
3
  A small agentic system that generates direct-to-consumer (DTC) ad copy,
 
1
+ ---
2
+ title: Self Improving Ad Copy Agent
3
+ emoji: 🧠
4
+ colorFrom: gray
5
+ colorTo: gray
6
+ sdk: docker
7
+ pinned: false
8
+ ---
9
+
10
  # Self-Improving Ad Copy Agent
11
 
12
  A small agentic system that generates direct-to-consumer (DTC) ad copy,