File size: 2,136 Bytes
67c9c05
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# ─── Hugging Face Spaces Dockerfile ──────────────────────
# Build:   docker build -t wellfound-ai .
# Run:     docker run -p 7860:7860 wellfound-ai
#
# HF Spaces auto-detects Dockerfile and builds on push.
# The Space proxies port 7860 to your public URL.

FROM python:3.11-slim

# ── System metadata (HF Spaces standard) ──
LABEL org.opencontainers.image.title="Wellfound AI"
LABEL org.opencontainers.image.description="AI-powered Excel data completion for Wellfound exports"

WORKDIR /app

# ── Layer 1: System dependencies (cached unless changed) ──
# Playwright needs these for headless Chromium in containers
RUN apt-get update && apt-get install -y --no-install-recommends \
    curl \
    wget \
    ca-certificates \
    fonts-liberation \
    libasound2 \
    libatk-bridge2.0-0 \
    libatk1.0-0 \
    libcairo2 \
    libcups2 \
    libdbus-1-3 \
    libdrm2 \
    libgbm1 \
    libglib2.0-0 \
    libnspr4 \
    libnss3 \
    libpango-1.0-0 \
    libxcomposite1 \
    libxdamage1 \
    libxfixes3 \
    libxkbcommon0 \
    libxrandr2 \
    xdg-utils \
    && rm -rf /var/lib/apt/lists/*

# ── Layer 2: Python dependencies (cached unless requirements change) ──
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
    pip install --no-cache-dir -r requirements.txt

# ── Layer 3: Playwright browser (separate - heavy but unchanged often) ──
RUN python -m playwright install chromium && \
    python -m playwright install-deps chromium

# ── Layer 4: Application code (changes most often) ──
COPY app.py .
COPY core/ ./core/
COPY templates/ ./templates/
COPY static/ ./static/

# ── Runtime setup ──
RUN mkdir -p data/uploads data/results data/checkpoints

# HF Spaces proxies port 7860 by default
EXPOSE 7860

# Environment defaults
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1

# Health check (HF Spaces uses this for status indicator)
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
    CMD curl -f http://localhost:7860/api/health || exit 1

CMD ["python", "app.py"]