File size: 474 Bytes
d1b3ee0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
## Use official py3.9
FROM python:3.9
## Set the workdir
WORKDIR /code
## CPY
COPY ./requirements.txt /code/requirements.txt
## Install
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
## Set up a new user
USER user
# Set env
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
# Setr Wrkdir
WORKDIR $HOME/app
# copy
COPY --chown=user . $HOME/app
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|