Spaces:
Sleeping
Sleeping
up docker
Browse files- Dockerfile +7 -3
Dockerfile
CHANGED
|
@@ -7,15 +7,19 @@ WORKDIR /app
|
|
| 7 |
COPY ./requirements.txt /app/requirements.txt
|
| 8 |
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
# Copy source code
|
| 11 |
COPY . /app
|
| 12 |
|
| 13 |
# Ensure run.sh is executable
|
| 14 |
RUN chmod +x /app/run.sh
|
| 15 |
|
| 16 |
-
# Set environment variable for NLTK data
|
| 17 |
-
ENV NLTK_DATA=/tmp/nltk_data
|
| 18 |
-
|
| 19 |
# Expose the port for Chainlit
|
| 20 |
EXPOSE 8000
|
| 21 |
|
|
|
|
| 7 |
COPY ./requirements.txt /app/requirements.txt
|
| 8 |
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
|
| 9 |
|
| 10 |
+
# Set environment variable for NLTK data (before downloading)
|
| 11 |
+
ENV NLTK_DATA=/app/nltk_data
|
| 12 |
+
|
| 13 |
+
# Create NLTK data directory and download required data
|
| 14 |
+
RUN mkdir -p /app/nltk_data && \
|
| 15 |
+
python -c "import nltk; nltk.download('twitter_samples', download_dir='/app/nltk_data'); nltk.download('stopwords', download_dir='/app/nltk_data')"
|
| 16 |
+
|
| 17 |
# Copy source code
|
| 18 |
COPY . /app
|
| 19 |
|
| 20 |
# Ensure run.sh is executable
|
| 21 |
RUN chmod +x /app/run.sh
|
| 22 |
|
|
|
|
|
|
|
|
|
|
| 23 |
# Expose the port for Chainlit
|
| 24 |
EXPOSE 8000
|
| 25 |
|