Spaces:
Runtime error
Runtime error
| # Telegram Multi-Part File Streamer - Dockerfile | |
| # Optimized for Hugging Face Spaces with low RAM footprint | |
| FROM python:3.11-slim | |
| # Set environment variables | |
| ENV PYTHONUNBUFFERED=1 \ | |
| PYTHONDONTWRITEBYTECODE=1 \ | |
| PIP_NO_CACHE_DIR=1 \ | |
| PIP_DISABLE_PIP_VERSION_CHECK=1 | |
| # Set working directory | |
| WORKDIR /app | |
| # Install system dependencies (minimal set) | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| gcc \ | |
| g++ \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements first for better caching | |
| COPY requirements.txt . | |
| # Install Python dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy application code | |
| COPY main.py . | |
| COPY session_manager.py . | |
| COPY database.py . | |
| COPY utils.py . | |
| # Create directory for session files (if needed) | |
| RUN mkdir -p /app/sessions | |
| # Health check | |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ | |
| CMD python -c "import requests; requests.get('http://localhost:8000/health')" | |
| # Expose port | |
| EXPOSE 8000 | |
| # Run the application | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1"] | |