FROM python:3.9-slim # Set working directory WORKDIR /code # Install system dependencies RUN apt-get update && apt-get install -y gcc && rm -rf /var/lib/apt/lists/* # Copy and install Python dependencies COPY requirements.txt . RUN pip install --no-cache-dir --upgrade -r requirements.txt # Set NLTK data path ENV NLTK_DATA=/usr/local/nltk_data # Download NLTK data to the correct location RUN mkdir -p $NLTK_DATA && \ python -m nltk.downloader -d $NLTK_DATA wordnet omw-1.4 # Copy source code COPY . . # Run app CMD ["python", "app.py"]