A-man123/text2textdocker
0
1## use the official python 3.9 image2FROM python:3.93 4##set the working directory to /code5WORKDIR /code6 7## copy the current directory contents in the /code8COPY ./requirements.txt /code/requirements.txt9 10## Install the requirements.txt11RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt12 13#set up a new user named "user"14RUN useradd user15USER user16 17#sett home user's home dir18 19ENV HOME=/home/user \20 PATH=/home/user/.local/bin:$HOME/app21 22#set the working diectory to the user's home directory23WORKDIR $HOME/app24#copy the current dir content into the container at $home/app seting the owner to25COPY --chown=user . $HOME/app26 27## start the fastapi on port 786028 29ENTRYPOINT ["uvicorn"]30CMD ["your_app:app", "--host", "0.0.0.0", "--port", "8000"]31 