Update Dockerfile
Browse files- Dockerfile +11 -4
Dockerfile
CHANGED
|
@@ -8,7 +8,6 @@ WORKDIR /app
|
|
| 8 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 9 |
ENV PYTHONUNBUFFERED=1
|
| 10 |
ENV PYTHONDONTWRITEBYTECODE=1
|
| 11 |
-
ENV NLTK_DATA=/app/nltk_data
|
| 12 |
|
| 13 |
# Copy requirements file and install Python dependencies
|
| 14 |
COPY requirements.txt requirements.txt
|
|
@@ -29,14 +28,22 @@ RUN apt-get update && apt-get install -y \
|
|
| 29 |
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
| 30 |
|
| 31 |
RUN pip install -r requirements.txt
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
| 35 |
RUN mkdir -p /app/nltk_data
|
|
|
|
| 36 |
# Pre-download required NLTK models
|
| 37 |
RUN python -m nltk.downloader -d /app/nltk_data \
|
| 38 |
punkt averaged_perceptron_tagger averaged_perceptron_tagger_eng
|
| 39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
# Expose the required port for HF Spaces
|
| 41 |
EXPOSE 7860
|
| 42 |
|
|
|
|
| 8 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 9 |
ENV PYTHONUNBUFFERED=1
|
| 10 |
ENV PYTHONDONTWRITEBYTECODE=1
|
|
|
|
| 11 |
|
| 12 |
# Copy requirements file and install Python dependencies
|
| 13 |
COPY requirements.txt requirements.txt
|
|
|
|
| 28 |
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
| 29 |
|
| 30 |
RUN pip install -r requirements.txt
|
| 31 |
+
# Fontconfig Warning Suppression (optional)
|
| 32 |
+
ENV FONTCONFIG_PATH=/etc/fonts
|
| 33 |
+
ENV FONTCONFIG_FILE=/etc/fonts/fonts.conf
|
| 34 |
+
|
| 35 |
+
# Set writable path for nltk data
|
| 36 |
+
ENV NLTK_DATA=/app/nltk_data
|
| 37 |
RUN mkdir -p /app/nltk_data
|
| 38 |
+
|
| 39 |
# Pre-download required NLTK models
|
| 40 |
RUN python -m nltk.downloader -d /app/nltk_data \
|
| 41 |
punkt averaged_perceptron_tagger averaged_perceptron_tagger_eng
|
| 42 |
|
| 43 |
+
RUN mkdir -p /app/cache /app/data && chmod -R 777 /app/cache /app/data
|
| 44 |
+
RUN mkdir -p /app/OUTPUTS
|
| 45 |
+
RUN chmod -R 777 /app
|
| 46 |
+
|
| 47 |
# Expose the required port for HF Spaces
|
| 48 |
EXPOSE 7860
|
| 49 |
|