# Use an official Python runtime as a parent image FROM python:3.10-slim # Set the working directory WORKDIR /app # Copy the requirements file into the container COPY requirements.txt /app/requirements.txt # Install any needed packages specified in requirements.txt RUN pip install --no-cache-dir -r requirements.txt # Copy the current directory contents into the container at /app COPY . /app # Create the logs and nltk_data directories and set permissions RUN mkdir -p /app/logs && chmod -R 777 /app/logs RUN mkdir -p /app/nltk_data && chmod -R 777 /app/nltk_data # Set the NLTK_DATA environment variable ENV NLTK_DATA=/app/nltk_data # Download NLTK data RUN python -c "import nltk; nltk.download('stopwords', download_dir='/app/nltk_data'); nltk.download('wordnet', download_dir='/app/nltk_data')" # Make port 7860 available to the world outside this container EXPOSE 7860 # Run the entrypoint script CMD ["sh", "./entrypoint.sh"]