Update Dockerfile
Browse files- Dockerfile +21 -8
Dockerfile
CHANGED
@@ -69,15 +69,16 @@ ENV PATH="/root/calibre:${PATH}"
|
|
69 |
# Set working directory
|
70 |
WORKDIR /app
|
71 |
|
72 |
-
# Create necessary directories
|
73 |
-
RUN mkdir -p /app/Working_files/Book
|
|
|
|
|
|
|
|
|
|
|
74 |
|
75 |
-
#
|
76 |
-
|
77 |
-
|
78 |
-
# Install Python dependencies
|
79 |
-
RUN pip install --upgrade pip
|
80 |
-
RUN pip install --no-cache-dir --verbose -r requirements.txt
|
81 |
|
82 |
# Set a writable cache directory for Hugging Face Transformers
|
83 |
ENV HF_HOME=/app/cache
|
@@ -91,6 +92,18 @@ RUN mkdir -p /app/cache/numba_cache && chmod -R 777 /app/cache/numba_cache
|
|
91 |
ENV MPLCONFIGDIR=/app/cache/matplotlib
|
92 |
RUN mkdir -p $MPLCONFIGDIR && chmod -R 777 $MPLCONFIGDIR
|
93 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
# Download NLTK data
|
95 |
RUN python -m nltk.downloader punkt
|
96 |
|
|
|
69 |
# Set working directory
|
70 |
WORKDIR /app
|
71 |
|
72 |
+
# Create necessary directories with proper permissions
|
73 |
+
RUN mkdir -p /app/Working_files/Book \
|
74 |
+
/app/Working_files/temp_ebook \
|
75 |
+
/app/Working_files/temp \
|
76 |
+
/app/Working_files/temp_converted \
|
77 |
+
/app/cache/fontconfig \
|
78 |
+
&& chmod -R 777 /app/Working_files /app/cache
|
79 |
|
80 |
+
# Set XDG_CACHE_HOME for Fontconfig to resolve cache directory issues
|
81 |
+
ENV XDG_CACHE_HOME=/app/cache
|
|
|
|
|
|
|
|
|
82 |
|
83 |
# Set a writable cache directory for Hugging Face Transformers
|
84 |
ENV HF_HOME=/app/cache
|
|
|
92 |
ENV MPLCONFIGDIR=/app/cache/matplotlib
|
93 |
RUN mkdir -p $MPLCONFIGDIR && chmod -R 777 $MPLCONFIGDIR
|
94 |
|
95 |
+
# Copy the requirements file
|
96 |
+
COPY requirements.txt .
|
97 |
+
|
98 |
+
# Install Python dependencies
|
99 |
+
RUN pip install --upgrade pip
|
100 |
+
RUN pip install --no-cache-dir --verbose -r requirements.txt
|
101 |
+
|
102 |
+
# Download Gradio's frpc_linux_amd64_v0.3 to resolve share link issue
|
103 |
+
RUN mkdir -p /usr/local/lib/python3.10/site-packages/gradio && \
|
104 |
+
wget -O /usr/local/lib/python3.10/site-packages/gradio/frpc_linux_amd64_v0.3 https://cdn-media.huggingface.co/frpc-gradio-0.3/frpc_linux_amd64 && \
|
105 |
+
chmod +x /usr/local/lib/python3.10/site-packages/gradio/frpc_linux_amd64_v0.3
|
106 |
+
|
107 |
# Download NLTK data
|
108 |
RUN python -m nltk.downloader punkt
|
109 |
|