mosmi/text2textwithDockerdesktop
0
1
2#use the official python image 3.9
3
4from python:3.9
5
6## set the working dir to /code
7WORKDIR /code
8
9## copy current dir content inthe container at /code
10COPY ./requirement.txt /code/requirement.txt
11
12## install the requirements.txt file
13RUN pip install --no-cache-dir --upgrade -r /code/requirement.txt
14
15#set up a new user name
16Run useradd user
17
18#switch to the 'user ' user
19USER user
20
21#set home to teh user's home directory
22
23ENV HOME=/home/user \
24 PATH=/home/user/.local/bin:$PATH
25
26# set the wroking dir to user's home dir
27WORKDIR $HOME/app
28
29## copy the curreent dir content into the container at $HOME/app setting teh owener to user
30COPY --chown=user . $HOME/app
31
32## start the FASTAPI App on the port
33
34CMD ["uvicorn","app:app","--host","0.0.0.0","--port", "8000"]
35
36
37
38 