Wellfound-AI / Dockerfile
Zoey7Web's picture
Upload 26 files
67c9c05 verified
Raw
History Blame Contribute Delete
2.14 kB
# ─── 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"]