File size: 803 Bytes
4035677
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e38ad60
5623197
4035677
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Dockerfile — unified build for Hugging Face Space
FROM python:3.10-slim

# Install system deps for building some Python packages
RUN apt-get update && apt-get install -y \
    build-essential \
    gcc \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Install Python dependencies first (caching layer)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy all project files
COPY . .

# Environment defaults (override with HF Secrets)
ENV POLYGON_RPC="https://polygon-rpc.com/"
ENV DB_PATH="/tmp/pol_indexer.sqlite"
ENV SCHEMA_PATH="schema.sql"
ENV CONFIRMATIONS="12"

# Expose port (Spaces expects 7860 or 8000 usually)
EXPOSE 7860

# Run FastAPI app with uvicorn (indexer runs in background thread)
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]