File size: 797 Bytes
451bc87
 
187a6e9
 
 
 
 
 
9c0fe6d
 
1261224
187a6e9
 
451bc87
9c0fe6d
9f54e81
 
9c0fe6d
 
 
9f54e81
9c0fe6d
8087eb1
451bc87
9c0fe6d
 
 
 
 
 
 
 
 
451bc87
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
FROM python:3.10.9

# Set the working directory to /app
WORKDIR /app

# Create a directory for storing downloaded PDF files
RUN mkdir /app/downloads

# Create a non-root user
RUN useradd -m appuser

# Copy the current directory contents into the container at /app
COPY . /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
    libgl1-mesa-glx \
    libglib2.0-0 \
    poppler-utils \
    tesseract-ocr

# Install Python dependencies
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt

# Change ownership of the app directory to the non-root user
RUN chown -R appuser:appuser /app

# Switch to the non-root user
USER appuser

# Set the nltk_data directory path
ENV NLTK_DATA /app/nltk_data

CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]