text2text_Docker / Dockerfile
rmz0312's picture
Upload Dockerfile
423b9ef verified
Raw
History Blame Contribute Delete
875 Bytes
#python image with version 3.9
FROM python:3.9
#set the working directory to /code
WORKDIR /code
#copy the requirements.txt file to the working directory
COPY ./requirements.txt /code/requirements.txt
#install the dependencies from the requirements.txt file
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
#Set up a new user named "user"
RUN useradd user
#Switch to the new user
USER user
#set home to the users home directory
ENV HOME=/home/user \
#Set the path to the users home directory
PATH=/home/user/.local/bin:$PATH
#set the working directory to the users home directory
WORKDIR $HOME/app
#Copy the contents of the current directory to the users home directory and set the ownership to the user
COPY --chown=user . $HOME/app
#Start the FAST API App on port 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]