Spaces:
Sleeping
Sleeping
| # Dockerfile - Untuk Hugging Face Spaces | |
| FROM python:3.10-slim | |
| # Set working directory | |
| WORKDIR /app | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| 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 all files | |
| COPY . . | |
| # Download NLTK data | |
| RUN python -c "import nltk; nltk.download('punkt'); nltk.download('stopwords')" | |
| # Create necessary directories | |
| RUN mkdir -p uploads data/processed models | |
| # Set environment variables | |
| ENV FLASK_ENV=production | |
| ENV PORT=7860 | |
| # Expose port | |
| EXPOSE 7860 | |
| # Run the app | |
| CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app_full:app"] |