dog/fastapi-document-qa
1
1# Use the official Python 3.9 image2FROM python:3.93 4RUN apt-get update && apt-get install -y \5 tesseract-ocr-all \6 && rm -rf /var/lib/apt/lists/*7 8# Set the working directory to /code9WORKDIR /code10 11# Copy the current directory contents into the container at /code12COPY ./requirements.txt /code/requirements.txt13 14# Install requirements.txt 15RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt16 17# Set up a new user named "user" with user ID 100018RUN useradd -m -u 1000 user19# Switch to the "user" user20USER user21# Set home to the user's home directory22ENV HOME=/home/user \23 PATH=/home/user/.local/bin:$PATH24 25# Set the working directory to the user's home directory26WORKDIR $HOME/app27 28# Copy the current directory contents into the container at $HOME/app setting the owner to the user29COPY --chown=user . $HOME/app30 31CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]