text2quiz_backend / Dockerfile
nhathuy07's picture
Update Dockerfile
5be7bb2 verified
raw
history blame
898 Bytes
FROM python:3.10
RUN apt-get update && apt-get install -y libgl1-mesa-glx libxext6 lsb-release curl gpg pandoc tesseract-ocr tesseract-ocr-vie tesseract-ocr-script-viet
RUN curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
RUN echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
RUN apt-get update && apt-get install redis
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app
COPY --chown=user ./requirements.txt $HOME/app/requirements.txt
RUN pip install --no-cache-dir --upgrade -r $HOME/app/requirements.txt
COPY --chown=user . $HOME/app
RUN mkdir nltk_data
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "4"]