From 087b6199305b6e55606da9fd247ba1f3d40bf5cc Mon Sep 17 00:00:00 2001 From: TheMaddax Date: Tue, 18 Mar 2025 11:11:10 -0500 Subject: [PATCH] Update Dockerfile --- Dockerfile | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 54ddfc6..c0b2e3a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,10 +22,33 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libxslt1.1 \ libffi-dev \ libssl-dev \ + pkg-config \ + python3-dev \ && rm -rf /var/lib/apt/lists/* -# Install OCRmyPDF -RUN pip install --no-cache-dir ocrmypdf +# Configure pip for better reliability +RUN pip config set global.timeout 1000 && \ + pip config set global.retries 10 && \ + pip config set global.default-timeout 1000 + +# Install core dependencies first +RUN pip install --no-cache-dir \ + Flask==2.3.3 \ + Flask-Login==0.6.3 \ + flask-cors==4.0.0 \ + bcrypt==4.1.2 \ + Pillow==10.0.0 \ + pytesseract==0.3.10 + +# Install OCRmyPDF and its dependencies +RUN pip install --no-cache-dir ocrmypdf==14.4.0 pdf2image==1.16.3 + +# Install AI-related dependencies +RUN pip install --no-cache-dir \ + google-genai==0.2.0 \ + openai==1.3.0 \ + mistralai==0.0.7 \ + beautifulsoup4==4.12.2 # Copy backend code COPY backend/ /app/backend/ @@ -33,10 +56,8 @@ COPY backend/ /app/backend/ # Copy built frontend assets into the backend's static folder COPY --from=frontend-build /app/frontend/build/ /app/backend/static/ -# Set working directory to backend and install Python dependencies +# Set working directory to backend WORKDIR /app/backend -COPY backend/requirements.txt . -RUN pip install --no-cache-dir -r requirements.txt EXPOSE 5015 CMD ["python", "app.py"]