Spaces:
No application file
No application file
#use the officialy python image | |
from python:3.9 | |
##set the working dir code | |
WORKDIR /code | |
##copy the current dir code | |
copy ./requirements.txt/code/requirements.txt | |
##install the requirement.txt | |
RUN pip install --no-cache-dir --upgrade -r code/requirements.txt | |
#set the new user name | |
RUN useradd user | |
##switch the user | |
USER user | |
##set home to user dir | |
ENV home = /home/user \ | |
path = /home/user/.local/bin:$PATH | |
#set the working dir | |
WORKDIR $HOME/app | |
##copy current dir | |
copy --chown=user . $HOME/app | |
##start the app port | |
CMD ["uvicorn","app:app","--host","0.0.0.0","--port","7860"] | |