gfathertech commited on
Commit
2b0f003
·
verified ·
1 Parent(s): c416a18

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -12
Dockerfile CHANGED
@@ -1,38 +1,30 @@
1
  FROM python:3.11-slim
2
 
3
- # Install system dependencies required by MarkItDown and document processors
4
  RUN apt-get update && apt-get install -y --no-install-recommends \
 
 
 
5
  ffmpeg \
6
  libsm6 \
7
  libxext6 \
8
  poppler-utils \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
- # Create user with UID 1000 for Hugging Face compatibility
12
  RUN useradd -m -u 1000 user
13
-
14
- # Set up environment variables and redirect cache folders to writable locations
15
  ENV HOME=/home/user \
16
  PATH="/home/user/.local/bin:$PATH" \
17
  HF_HOME=/tmp/huggingface \
18
  TMPDIR=/tmp
19
 
20
  WORKDIR /app
21
-
22
- # Switch to root to create the working directory and assign ownership
23
  RUN chown -R user:user /app
24
-
25
- # Switch to non-root user
26
  USER user
27
 
28
- # Install Python dependencies first to leverage Docker layer caching
29
  COPY --chown=user requirements.txt .
30
  RUN pip install --no-cache-dir --user -r requirements.txt
31
 
32
- # Copy remaining project files
33
  COPY --chown=user . .
34
 
35
  EXPOSE 7860
36
-
37
- # Launch Uvicorn using the FastAPI instance (app:app)
38
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.11-slim
2
 
3
+ # Install system dependencies: Tesseract OCR, LibreOffice, FFmpeg, Poppler
4
  RUN apt-get update && apt-get install -y --no-install-recommends \
5
+ tesseract-ocr \
6
+ tesseract-ocr-eng \
7
+ libreoffice \
8
  ffmpeg \
9
  libsm6 \
10
  libxext6 \
11
  poppler-utils \
12
  && rm -rf /var/lib/apt/lists/*
13
 
 
14
  RUN useradd -m -u 1000 user
 
 
15
  ENV HOME=/home/user \
16
  PATH="/home/user/.local/bin:$PATH" \
17
  HF_HOME=/tmp/huggingface \
18
  TMPDIR=/tmp
19
 
20
  WORKDIR /app
 
 
21
  RUN chown -R user:user /app
 
 
22
  USER user
23
 
 
24
  COPY --chown=user requirements.txt .
25
  RUN pip install --no-cache-dir --user -r requirements.txt
26
 
 
27
  COPY --chown=user . .
28
 
29
  EXPOSE 7860
 
 
30
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]