|
FROM python:3.9 |
|
|
|
RUN apt update && \ |
|
apt install -y bash \ |
|
poppler-utils \ |
|
tesseract-ocr \ |
|
libtesseract-dev \ |
|
build-essential \ |
|
git \ |
|
curl \ |
|
ca-certificates \ |
|
python3 \ |
|
python3-pip && \ |
|
rm -rf /var/lib/apt/lists |
|
|
|
RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y |
|
|
|
WORKDIR /code |
|
|
|
COPY ./requirements.txt /code/requirements.txt |
|
|
|
|
|
RUN useradd -m -u 1000 user |
|
|
|
|
|
USER user |
|
|
|
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt |
|
|
|
RUN [ "python", "-c", "import nltk; nltk.download('punkt')" ] |
|
|
|
|
|
ENV HOME=/home/user \ |
|
PATH=/home/user/.local/bin:$PATH |
|
|
|
|
|
WORKDIR $HOME/app |
|
|
|
|
|
COPY --chown=user . $HOME/app |
|
|
|
COPY . . |
|
|
|
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.enableXsrfProtection=false"] |
|
|