Spaces:
Paused
Paused
| # Use lightweight Python image | |
| FROM python:3.10-slim | |
| # Environment variables | |
| ENV PYTHONDONTWRITEBYTECODE=1 | |
| ENV PYTHONUNBUFFERED=1 | |
| # Working directory | |
| WORKDIR /app | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| curl \ | |
| ca-certificates \ | |
| # lklklkl | |
| && rm -rf /var/lib/apt/lists/* | |
| # Install cloudflared (NO sudo, NO service install) | |
| RUN curl -fsSL https://pkg.cloudflare.com/cloudflare-public-v2.gpg \ | |
| | tee /usr/share/keyrings/cloudflare-public-v2.gpg >/dev/null && \ | |
| echo "deb [signed-by=/usr/share/keyrings/cloudflare-public-v2.gpg] https://pkg.cloudflare.com/cloudflared any main" \ | |
| | tee /etc/apt/sources.list.d/cloudflared.list && \ | |
| apt-get update && \ | |
| apt-get install -y cloudflared && \ | |
| rm -rf /var/lib/apt/lists/* | |
| # Copy requirements first (better caching) | |
| COPY requirements.txt . | |
| # Install Python deps | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy app | |
| COPY app.py . | |
| # Expose HF port | |
| EXPOSE 7860 | |
| # Start Flask + cloudflared together | |
| CMD cloudflared tunnel run --token $CLOUDFLARED_TOKEN & python app.py | |