Spaces:
Sleeping
Sleeping
| FROM python:3.11-slim | |
| # Set working directory (use a writable folder) | |
| WORKDIR /app | |
| # Copy and install dependencies | |
| COPY ./requirements.txt /app/requirements.txt | |
| RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt | |
| # Set environment variable for NLTK data (before downloading) | |
| ENV NLTK_DATA=/app/nltk_data | |
| # Create NLTK data directory and download required data | |
| RUN mkdir -p /app/nltk_data && \ | |
| python -c "import nltk; nltk.data.path.append('/app/nltk_data'); nltk.download('twitter_samples', download_dir='/app/nltk_data'); nltk.download('stopwords', download_dir='/app/nltk_data')" | |
| # Pre-download NLTK data into the app folder | |
| #RUN python -m nltk.downloader -d /app/nltk_data twitter_samples | |
| # Copy source code | |
| COPY . /app | |
| # Expose the port for Chainlit | |
| EXPOSE 8000 | |
| # Run the app | |
| CMD ["uvicorn", "app:app", "--port", "7860", "--host", "0.0.0.0"] |