File size: 871 Bytes
b2e1431
 
 
 
 
 
 
 
 
2c92ec9
 
 
 
f31ff01
 
 
f959c69
f31ff01
2c92ec9
b2e1431
 
 
 
 
 
 
a75f957
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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"]