Update Dockerfile
This commit is contained in:
parent
48c31fa758
commit
087b619930
1 changed files with 26 additions and 5 deletions
31
Dockerfile
31
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"]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue