multiocr / Dockerfile
Aravindh
file copy
33a0bbe
# read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
# you will also find guides on how best to write your Dockerfile
FROM python:3.9
RUN apt-get update && apt-get install build-essential -y
RUN apt-get update && apt-get install software-properties-common -y
# RUN apt-get -y install gcc mono-mcs openssl && \
# rm -rf /var/lib/apt/lists/*
# RUN add-apt-repository ppa:alex-p/tesseract-ocr-devel
RUN apt-get update
RUN apt-get install tesseract-ocr -y
RUN wget http://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.19_amd64.deb \
&& dpkg -i libssl1.1_1.1.1f-1ubuntu2.19_amd64.deb
RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y
RUN useradd -m -u 1000 user
USER user
# Set home to the user's home directory
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app
COPY --chown=user . $HOME/app
COPY ./requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
COPY . /app/
USER root
RUN chmod 777 /app/*
USER user
EXPOSE 7860 7860
CMD ["python", "/app/app.py"]